From 9d1014f0afdcf2c5897019448f42e1352ae8c1f2 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 6 Oct 2018 19:08:06 -0700 Subject: Added debug check to DeviceContextD3D12Impl::FinishFrame() to verify there are no outstanding commands in the context --- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 263e4ecd..719c5f48 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -576,6 +576,11 @@ namespace Diligent void DeviceContextD3D12Impl::FinishFrame() { + if (GetNumCommandsInCtx() != 0) + LOG_ERROR_MESSAGE(m_bIsDeferred ? + "There are outstanding commands in the deferred device context when finishing the frame. This is an error and may cause unpredicted behaviour. Close all deferred contexts and execute them before finishing the frame" : + "There are outstanding commands in the immediate device context when finishing the frame. This is an error and may cause unpredicted behaviour. Call Flush() to submit all commands for execution before finishing the frame"); + VERIFY_EXPR(m_bIsDeferred || m_SubmittedBuffersCmdQueueMask == (Uint64{1}<