summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
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/GraphicsEngineVulkan
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/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 865d4177..583feb6f 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -207,16 +207,19 @@ namespace Diligent
}
- void DeviceContextVkImpl::SetPipelineState(IPipelineState *pPipelineState)
+ void DeviceContextVkImpl::SetPipelineState(IPipelineState* pPipelineState)
{
+ auto* pPipelineStateVk = ValidatedCast<PipelineStateVkImpl>(pPipelineState);
+ if (PipelineStateVkImpl::IsSameObject(m_pPipelineState, pPipelineStateVk))
+ return;
+
// Never flush deferred context!
if (!m_bIsDeferred && m_State.NumCommands >= m_NumCommandsToFlush)
{
Flush();
}
- auto* pPipelineStateVk = ValidatedCast<PipelineStateVkImpl>(pPipelineState);
- const auto& PSODesc = pPipelineStateVk->GetDesc();
+ const auto& PSODesc = pPipelineStateVk->GetDesc();
bool CommitStates = false;
bool CommitScissor = false;