From eefdd4ab99fa99ed326b68cd2b0d4024347ed8fc Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Tue, 28 May 2024 02:05:12 +0200 Subject: 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 --- tools/gfx/d3d12/d3d12-command-encoder.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/gfx/d3d12/d3d12-command-encoder.cpp') 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; -- cgit v1.2.3