summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan/vk-command-encoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/vulkan/vk-command-encoder.cpp')
-rw-r--r--tools/gfx/vulkan/vk-command-encoder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/gfx/vulkan/vk-command-encoder.cpp b/tools/gfx/vulkan/vk-command-encoder.cpp
index 00915e0c4..33cd567c7 100644
--- a/tools/gfx/vulkan/vk-command-encoder.cpp
+++ b/tools/gfx/vulkan/vk-command-encoder.cpp
@@ -1460,14 +1460,15 @@ void RayTracingCommandEncoder::dispatchRays(
m_currentPipeline,
m_commandBuffer->m_transientHeap,
static_cast<ResourceCommandEncoder*>(this));
+ auto shaderTableAddr = shaderTableBuffer->getDeviceAddress();
VkStridedDeviceAddressRegionKHR raygenSBT;
- raygenSBT.deviceAddress = shaderTableBuffer->getDeviceAddress();
raygenSBT.stride = VulkanUtil::calcAligned(alignedHandleSize, rtProps.shaderGroupBaseAlignment);
+ raygenSBT.deviceAddress = shaderTableAddr + raygenShaderIndex * raygenSBT.stride;
raygenSBT.size = raygenSBT.stride;
VkStridedDeviceAddressRegionKHR missSBT;
- missSBT.deviceAddress = raygenSBT.deviceAddress + raygenSBT.size;
+ missSBT.deviceAddress = shaderTableAddr + shaderTableImpl->m_raygenTableSize;
missSBT.stride = alignedHandleSize;
missSBT.size = shaderTableImpl->m_missTableSize;