summaryrefslogtreecommitdiff
path: root/tools/gfx/d3d12/d3d12-shader-table.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-08-20 01:03:06 -0700
committerGitHub <noreply@github.com>2022-08-20 01:03:06 -0700
commitaf70651a4843b16dd24e14b5cedffe399ebeb862 (patch)
treea6aefd5db94a048114b9a8d7ed3f826533105fab /tools/gfx/d3d12/d3d12-shader-table.cpp
parent6412c4913b6a063438bb11863f2c154d3ae42dfe (diff)
Call `gfx` in slang program. (#2370)
Diffstat (limited to 'tools/gfx/d3d12/d3d12-shader-table.cpp')
-rw-r--r--tools/gfx/d3d12/d3d12-shader-table.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/gfx/d3d12/d3d12-shader-table.cpp b/tools/gfx/d3d12/d3d12-shader-table.cpp
index ef4feecc7..2773578b8 100644
--- a/tools/gfx/d3d12/d3d12-shader-table.cpp
+++ b/tools/gfx/d3d12/d3d12-shader-table.cpp
@@ -17,12 +17,11 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer(
TransientResourceHeapBase* transientHeap,
IResourceCommandEncoder* encoder)
{
- uint32_t raygenTableSize = m_rayGenShaderCount * D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES;
+ uint32_t raygenTableSize = m_rayGenShaderCount * kRayGenRecordSize;
uint32_t missTableSize = m_missShaderCount * D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES;
uint32_t hitgroupTableSize = m_hitGroupCount * D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES;
m_rayGenTableOffset = 0;
- m_missTableOffset = (uint32_t)D3DUtil::calcAligned(
- raygenTableSize, D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT);
+ m_missTableOffset = raygenTableSize;
m_hitGroupTableOffset = (uint32_t)D3DUtil::calcAligned(
m_missTableOffset + missTableSize, D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT);
uint32_t tableSize = m_hitGroupTableOffset + hitgroupTableSize;
@@ -72,7 +71,7 @@ RefPtr<BufferResource> ShaderTableImpl::createDeviceBuffer(
for (uint32_t i = 0; i < m_rayGenShaderCount; i++)
{
copyShaderIdInto(
- stagingBufferPtr + m_rayGenTableOffset + D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES * i,
+ stagingBufferPtr + m_rayGenTableOffset + kRayGenRecordSize * i,
m_shaderGroupNames[i],
m_recordOverwrites[i]);
}