summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-28 04:52:27 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:12 +0000
commitb2efe4d2393dd9e285f163945cdca9b0dbe5093d (patch)
tree0cd01fe3a0efa9c58042b6b6d198421b0821215a /Graphics/GraphicsEngineD3D12
parentPipelineResourceSignatureD3D12Impl: updated immutable samplers handling plus ... (diff)
downloadDiligentCore-b2efe4d2393dd9e285f163945cdca9b0dbe5093d.tar.gz
DiligentCore-b2efe4d2393dd9e285f163945cdca9b0dbe5093d.zip
Few minor updates to DeviceContextD3D12Impl
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.hpp2
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp11
2 files changed, 8 insertions, 5 deletions
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<class ShaderResourceBindingD3D12Impl*, MAX_RESOURCE_SIGNATURES> 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();