diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2024-05-28 02:05:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-27 17:05:12 -0700 |
| commit | eefdd4ab99fa99ed326b68cd2b0d4024347ed8fc (patch) | |
| tree | 22fdde5317e337ea5307c3487038a5191db9b0f3 /tools/gfx/d3d12/d3d12-command-encoder.cpp | |
| parent | d9443d670ef8413971fe7c3f02368b60a7fc5904 (diff) | |
add support for callable shaders in gfx (#3460)
Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx/d3d12/d3d12-command-encoder.cpp')
| -rw-r--r-- | tools/gfx/d3d12/d3d12-command-encoder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/gfx/d3d12/d3d12-command-encoder.cpp b/tools/gfx/d3d12/d3d12-command-encoder.cpp index ff50dcc5f..892c792fb 100644 --- a/tools/gfx/d3d12/d3d12-command-encoder.cpp +++ b/tools/gfx/d3d12/d3d12-command-encoder.cpp @@ -1409,6 +1409,15 @@ Result RayTracingCommandEncoderImpl::dispatchRays( dispatchDesc.HitGroupTable.StrideInBytes = D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES; } + if (shaderTableImpl->m_callableShaderCount > 0) + { + dispatchDesc.CallableShaderTable.StartAddress = + shaderTableAddr + shaderTableImpl->m_callableTableOffset; + dispatchDesc.CallableShaderTable.SizeInBytes = + shaderTableImpl->m_callableShaderCount * D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES; + dispatchDesc.CallableShaderTable.StrideInBytes = D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES; + } + dispatchDesc.Width = (UINT)width; dispatchDesc.Height = (UINT)height; dispatchDesc.Depth = (UINT)depth; |
