summaryrefslogtreecommitdiff
path: root/tools/gfx
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-01-25 15:34:34 -0800
committerGitHub <noreply@github.com>2022-01-25 15:34:34 -0800
commit10470f8796de5b4fe48a83d50cda75a4188c06e3 (patch)
treeb6e9ef9422527c158dcfbe6ad35f4e8525be4af7 /tools/gfx
parent618acb24fdd8e3c447e4ab8826ea9a4eb117885b (diff)
gfx: Allow null entries in shader table. (#2096)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx')
-rw-r--r--tools/gfx/d3d12/render-d3d12.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp
index 1b146bc4e..b2227aa76 100644
--- a/tools/gfx/d3d12/render-d3d12.cpp
+++ b/tools/gfx/d3d12/render-d3d12.cpp
@@ -3294,8 +3294,15 @@ public:
auto copyShaderIdInto = [&](void* dest, String& name)
{
- void* shaderId = stateObjectProperties->GetShaderIdentifier(name.toWString().begin());
- memcpy(dest, shaderId, D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES);
+ if (name.getLength())
+ {
+ void* shaderId = stateObjectProperties->GetShaderIdentifier(name.toWString().begin());
+ memcpy(dest, shaderId, D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES);
+ }
+ else
+ {
+ memset(dest, 0, D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES);
+ }
};
uint8_t* stagingBufferPtr = (uint8_t*)stagingPtr;