Function Prototype

vkGetRayTracingCaptureReplayShaderGroupHandlesKHR

Query opaque capture replay data for pipeline shader group handles

To query the opaque capture data of shader groups in a ray tracing pipeline, call:

VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
    VkDevice device,
    VkPipeline pipeline,
    uint32_t firstGroup,
    uint32_t groupCount,
    size_t dataSize,
    void* pData);
  • device is the logical device containing the ray tracing pipeline.
  • pipeline is the ray tracing pipeline object containing the shaders.
  • firstGroup is the index of the first group to retrieve a handle for from the VkRayTracingPipelineCreateInfoKHR::pGroups array.
  • groupCount is the number of shader handles to retrieve.
  • dataSize is the size in bytes of the buffer pointed to by pData.
  • pData is a pointer to an application-allocated buffer where the results will be written.

On success, an array of groupCount shader handles will be written to pData, with each element being of size VkPhysicalDeviceRayTracingPipelinePropertiesKHR::shaderGroupHandleCaptureReplaySize.

Once queried, this opaque data can be provided at pipeline creation time (in a subsequent execution), using VkRayTracingShaderGroupCreateInfoKHR::pShaderGroupCaptureReplayHandle, as described in Ray Tracing Capture Replay.

If pipeline was created with VK_PIPELINE_CREATE_LIBRARY_BIT_KHR and the pipelineLibraryGroupHandles feature is enabled applications can query capture replay group handles from that pipeline. The capture replay handle remains bitwise identical for any pipeline which references the pipeline library. Group indices are assigned as-if the pipeline was created without VK_PIPELINE_CREATE_LIBRARY_BIT_KHR.

Valid Usage

VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-04051

firstGroup must be less than the number of shader groups in pipeline

VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-03483

The sum of firstGroup and groupCount must be less than or equal to the number of shader groups in pipeline

VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03606

VkPhysicalDeviceRayTracingPipelineFeaturesKHR::rayTracingPipelineShaderGroupHandleCaptureReplaymust be enabled to call this function

VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-03607

pipeline must have been created with a flags that included VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR

VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pipeline-07829

If the pipelineLibraryGroupHandles feature is not enabled, pipeline must not have been created with VK_PIPELINE_CREATE_LIBRARY_BIT_KHR