diff options
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
3 files changed, 13 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h index 3e3577af..5bb92d51 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h @@ -53,7 +53,15 @@ public: ~CommandListD3D12Impl() { - DEV_CHECK_ERR(m_pCmdContext == nullptr && m_pDeferredCtx == nullptr, "Destroying a command list that has not been executed"); + if (m_pCmdContext != nullptr) + { + LOG_WARNING_MESSAGE("Destroying command list that has not been executed"); + m_pDevice->DisposeCommandContext(std::move(m_pCmdContext)); + } + else + { + VERIFY_EXPR(m_pDeferredCtx == nullptr); + } } RenderDeviceD3D12Impl::PooledCommandContext Close(RefCntAutoPtr<DeviceContextD3D12Impl>& pDeferredCtx) diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 64fd4817..42532555 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -606,6 +606,8 @@ namespace Diligent m_State = State{}; + // Setting pipeline state to null makes sure that render targets and other + // states will be restored in the command list next time a PSO is bound. m_pPipelineState = nullptr; } diff --git a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp index 0dfa412f..a11d698a 100644 --- a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp @@ -147,8 +147,8 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat CComPtr<ID3D12Device> d3d12Device; try { -#ifdef DEVELOPMENT // Enable the D3D12 debug layer. + if (EngineCI.EnableDebugLayer) { CComPtr<ID3D12Debug> debugController; if (SUCCEEDED(D3D12GetDebugInterface(__uuidof(debugController), reinterpret_cast<void**>(static_cast<ID3D12Debug**>(&debugController)) ))) @@ -156,7 +156,6 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat debugController->EnableDebugLayer(); } } -#endif CComPtr<IDXGIFactory4> factory; HRESULT hr = CreateDXGIFactory1(__uuidof(factory), reinterpret_cast<void**>(static_cast<IDXGIFactory4**>(&factory)) ); @@ -199,7 +198,7 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat CHECK_D3D_RESULT_THROW(hr, "Failed to crate warp device"); } -#ifdef DEVELOPMENT + if (EngineCI.EnableDebugLayer) { CComPtr<ID3D12InfoQueue> pInfoQueue; hr = d3d12Device->QueryInterface(__uuidof(pInfoQueue), reinterpret_cast<void**>(static_cast<ID3D12InfoQueue**>(&pInfoQueue))); @@ -235,7 +234,6 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat VERIFY(SUCCEEDED(hr), "Failed to set break on error"); } } -#endif #ifndef RELEASE // Prevent the GPU from overclocking or underclocking to get consistent timings |
