C Specification
To dispatch ray tracing use:
// Provided by VK_NV_ray_tracing
void vkCmdTraceRaysNV(
VkCommandBuffer commandBuffer,
VkBuffer raygenShaderBindingTableBuffer,
VkDeviceSize raygenShaderBindingOffset,
VkBuffer missShaderBindingTableBuffer,
VkDeviceSize missShaderBindingOffset,
VkDeviceSize missShaderBindingStride,
VkBuffer hitShaderBindingTableBuffer,
VkDeviceSize hitShaderBindingOffset,
VkDeviceSize hitShaderBindingStride,
VkBuffer callableShaderBindingTableBuffer,
VkDeviceSize callableShaderBindingOffset,
VkDeviceSize callableShaderBindingStride,
uint32_t width,
uint32_t height,
uint32_t depth);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
raygenShaderBindingTableBuffer
is the buffer object that holds the shader binding table data for the ray generation shader stage. -
raygenShaderBindingOffset
is the offset in bytes (relative toraygenShaderBindingTableBuffer
) of the ray generation shader being used for the trace. -
missShaderBindingTableBuffer
is the buffer object that holds the shader binding table data for the miss shader stage. -
missShaderBindingOffset
is the offset in bytes (relative tomissShaderBindingTableBuffer
) of the miss shader being used for the trace. -
missShaderBindingStride
is the size in bytes of each shader binding table record inmissShaderBindingTableBuffer
. -
hitShaderBindingTableBuffer
is the buffer object that holds the shader binding table data for the hit shader stages. -
hitShaderBindingOffset
is the offset in bytes (relative tohitShaderBindingTableBuffer
) of the hit shader group being used for the trace. -
hitShaderBindingStride
is the size in bytes of each shader binding table record inhitShaderBindingTableBuffer
. -
callableShaderBindingTableBuffer
is the buffer object that holds the shader binding table data for the callable shader stage. -
callableShaderBindingOffset
is the offset in bytes (relative tocallableShaderBindingTableBuffer
) of the callable shader being used for the trace. -
callableShaderBindingStride
is the size in bytes of each shader binding table record incallableShaderBindingTableBuffer
. -
width
is the width of the ray trace query dimensions. -
height
is height of the ray trace query dimensions. -
depth
is depth of the ray trace query dimensions.
Description
When the command is executed, a ray generation group of width
× height
× depth
rays is assembled.
See Also
VK_NV_ray_tracing, VkBuffer, VkCommandBuffer, VkDeviceSize
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.