C Specification
To dispatch ray tracing, with some parameters sourced on the device, use:
// Provided by VK_KHR_ray_tracing
void vkCmdTraceRaysIndirectKHR(
VkCommandBuffer commandBuffer,
const VkStridedBufferRegionKHR* pRaygenShaderBindingTable,
const VkStridedBufferRegionKHR* pMissShaderBindingTable,
const VkStridedBufferRegionKHR* pHitShaderBindingTable,
const VkStridedBufferRegionKHR* pCallableShaderBindingTable,
VkBuffer buffer,
VkDeviceSize offset);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
pRaygenShaderBindingTable
is a VkStridedBufferRegionKHR that holds the shader binding table data for the ray generation shader stage. -
pMissShaderBindingTable
is a VkStridedBufferRegionKHR that holds the shader binding table data for the miss shader stage. -
pHitShaderBindingTable
is a VkStridedBufferRegionKHR that holds the shader binding table data for the hit shader stage. -
pCallableShaderBindingTable
is a VkStridedBufferRegionKHR that holds the shader binding table data for the callable shader stage. -
buffer
is the buffer containing the trace ray parameters. -
offset
is the byte offset intobuffer
where parameters begin.
Description
vkCmdTraceRaysIndirectKHR
behaves similarly to vkCmdTraceRaysKHR
except that the ray trace query dimensions are read by the device from
buffer
during execution.
The parameters of trace ray are encoded in the
VkTraceRaysIndirectCommandKHR structure located at offset
bytes
in buffer
.
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
, VkStridedBufferRegionKHR
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.