summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-05-05 17:15:10 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-05-05 17:15:10 +0000
commitc9655a6749434bb463d615754cbb910c7183c49e (patch)
treed856b68ba47521b1389147627468626cc8960298 /Graphics/GraphicsEngineD3D12
parentFixed overload of WindowsStoreFile::Read() function (diff)
downloadDiligentCore-c9655a6749434bb463d615754cbb910c7183c49e.tar.gz
DiligentCore-c9655a6749434bb463d615754cbb910c7183c49e.zip
Added safe check that same PSO is being bound
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp5
1 files changed, 4 insertions, 1 deletions
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<PipelineStateD3D12Impl>(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<PipelineStateD3D12Impl>(pPipelineState);
const auto &PSODesc = pPipelineStateD3D12->GetDesc();
bool CommitStates = false;