diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-08-05 02:21:19 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-05 02:21:19 +0000 |
| commit | 3ce2d21558fa0568ab7d332a5c300a661e444f44 (patch) | |
| tree | d0e437d0d88658844e0134b1c8ac6ef27e96a296 /Graphics/GraphicsEngineD3D12 | |
| parent | Implemented input attachments in Vulkan backend; added test (diff) | |
| download | DiligentCore-3ce2d21558fa0568ab7d332a5c300a661e444f44.tar.gz DiligentCore-3ce2d21558fa0568ab7d332a5c300a661e444f44.zip | |
Added more renderpass-related checks
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 4ab5455d..c5ebdc84 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -245,7 +245,12 @@ void DeviceContextD3D12Impl::SetPipelineState(IPipelineState* pPipelineState) void DeviceContextD3D12Impl::TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) { - VERIFY_EXPR(pPipelineState != nullptr); + DEV_CHECK_ERR(pPipelineState != nullptr, "Pipeline state must mot be null"); + if (m_pActiveRenderPass) + { + LOG_ERROR_MESSAGE("State transitions are not allowed inside a render pass."); + return; + } auto& Ctx = GetCmdContext(); @@ -707,6 +712,11 @@ void DeviceContextD3D12Impl::Flush() return; } + if (m_pActiveRenderPass != nullptr) + { + LOG_ERROR_MESSAGE("Flushing device context inside an active render pass."); + } + Flush(true); } @@ -1670,6 +1680,8 @@ void DeviceContextD3D12Impl::GenerateMips(ITextureView* pTexView) void DeviceContextD3D12Impl::FinishCommandList(ICommandList** ppCommandList) { + VERIFY(m_pActiveRenderPass == nullptr, "Finishing command list inside an active render pass."); + CommandListD3D12Impl* pCmdListD3D12(NEW_RC_OBJ(m_CmdListAllocator, "CommandListD3D12Impl instance", CommandListD3D12Impl)(m_pDevice, this, std::move(m_CurrCmdCtx))); pCmdListD3D12->QueryInterface(IID_CommandList, reinterpret_cast<IObject**>(ppCommandList)); Flush(true); @@ -1757,6 +1769,8 @@ void DeviceContextD3D12Impl::EndQuery(IQuery* pQuery) void DeviceContextD3D12Impl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) { + VERIFY(m_pActiveRenderPass == nullptr, "State transitions are not allowed inside a render pass"); + auto& CmdCtx = GetCmdContext(); for (Uint32 i = 0; i < BarrierCount; ++i) { |
