From b2efe4d2393dd9e285f163945cdca9b0dbe5093d Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 27 Feb 2021 20:52:27 -0800 Subject: Few minor updates to DeviceContextD3D12Impl --- .../GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp | 2 +- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp index 67092a1d..91c3f6f7 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp @@ -395,7 +395,7 @@ private: Bitfield DynamicBuffersMask = 0; // Indicates which SRBs have dynamic buffers bool bRootViewsCommitted = false; // Indicates if root views have been committed since the time SRB has been committed. bool bRootTablesCommited = false; - ID3D12RootSignature* pRootSig = nullptr; + ID3D12RootSignature* pd3d12RootSig = nullptr; std::array SRBs{}; diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 68407d16..b9a0f91e 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -227,12 +227,12 @@ void DeviceContextD3D12Impl::SetPipelineState(IPipelineState* pPipelineState) auto& CmdCtx = GetCmdContext(); auto& RootInfo = GetRootTableInfo(PSODesc.PipelineType); - auto* pd3d12RootSig = pPipelineStateD3D12->GetRootSignature().GetD3D12RootSignature(); + auto* pd3d12RootSig = pPipelineStateD3D12->GetD3D12RootSignature(); - if (RootInfo.pRootSig != pd3d12RootSig) + if (RootInfo.pd3d12RootSig != pd3d12RootSig) { // When root signature changes, all root resoruces must be committed - RootInfo.pRootSig = pd3d12RootSig; + RootInfo.pd3d12RootSig = pd3d12RootSig; RootInfo.bRootTablesCommited = false; RootInfo.bRootViewsCommitted = false; RootInfo.ActiveSRBMask = 0; @@ -314,7 +314,10 @@ void DeviceContextD3D12Impl::CommitRootTablesAndViews(RootTableInfo& RootInfo) continue; auto* const pSRB = RootInfo.SRBs[s]; - DEV_CHECK_ERR(pSRB != nullptr, "No SRB is committed and binding index ", s); + DEV_CHECK_ERR(pSRB != nullptr, "No SRB is committed at binding index ", s); + if (pSRB == nullptr) + continue; + VERIFY_EXPR(pSRB->GetBindingIndex() == s); const auto& ResourceCache = pSRB->GetResourceCache(); -- cgit v1.2.3