diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-08-06 18:30:15 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-06 18:30:15 +0000 |
| commit | 6e663135a6d194f5ed8b41f112c6d5a2c98b080d (patch) | |
| tree | c5e4f26bfdc01c29e23b2f3f8706891730ded78c /Graphics | |
| parent | Fixed GCC compiler warnings (diff) | |
| download | DiligentCore-6e663135a6d194f5ed8b41f112c6d5a2c98b080d.tar.gz DiligentCore-6e663135a6d194f5ed8b41f112c6d5a2c98b080d.zip | |
Added few debug checks
Diffstat (limited to 'Graphics')
3 files changed, 16 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp index c932d3b4..4df47bfc 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp @@ -750,6 +750,9 @@ inline void DeviceContextBase<BaseInterface, ImplementationTraits>::ClearStateCa m_NumScissorRects = 0; ResetRenderTargets(); + + m_pActiveRenderPass = nullptr; + m_pBoundFramebuffer = nullptr; } template <typename BaseInterface, typename ImplementationTraits> diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index c5ebdc84..ba443c13 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -758,6 +758,11 @@ void DeviceContextD3D12Impl::FinishFrame() "All queries must be ended before the frame is finished."); } + if (m_pActiveRenderPass != nullptr) + { + LOG_ERROR_MESSAGE("Finishing frame inside an active render pass."); + } + VERIFY_EXPR(m_bIsDeferred || m_SubmittedBuffersCmdQueueMask == (Uint64{1} << m_CommandQueueId)); // Released pages are returned to the global dynamic memory manager hosted by render device. diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 5f26479d..3162e3be 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -911,6 +911,11 @@ void DeviceContextVkImpl::FinishFrame() "All queries must be ended before the frame is finished."); } + if (m_pActiveRenderPass != nullptr) + { + LOG_ERROR_MESSAGE("Finishing frame inside an active render pass."); + } + if (!m_MappedTextures.empty()) LOG_ERROR_MESSAGE("There are mapped textures in the device context when finishing the frame. All dynamic resources must be used in the same frame in which they are mapped."); @@ -1012,7 +1017,9 @@ void DeviceContextVkImpl::Flush() m_State = ContextState{}; m_DescrSetBindInfo.Reset(); m_CommandBuffer.Reset(); - m_pPipelineState = nullptr; + m_pPipelineState = nullptr; + m_pActiveRenderPass = nullptr; + m_pBoundFramebuffer = nullptr; } void DeviceContextVkImpl::SetVertexBuffers(Uint32 StartSlot, |
