From c9655a6749434bb463d615754cbb910c7183c49e Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 5 May 2019 10:15:10 -0700 Subject: Added safe check that same PSO is being bound --- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index e4c04ba4..3c1a4ca6 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -165,13 +165,16 @@ namespace Diligent void DeviceContextD3D12Impl::SetPipelineState(IPipelineState* pPipelineState) { + auto* pPipelineStateD3D12 = ValidatedCast(pPipelineState); + if (PipelineStateD3D12Impl::IsSameObject(m_pPipelineState, pPipelineStateD3D12)) + return; + // Never flush deferred context! if (!m_bIsDeferred && m_State.NumCommands >= m_NumCommandsToFlush) { Flush(true); } - auto* pPipelineStateD3D12 = ValidatedCast(pPipelineState); const auto &PSODesc = pPipelineStateD3D12->GetDesc(); bool CommitStates = false; -- cgit v1.2.3