| public static void vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, long indirectDeviceAddress) Initialize an indirect ray tracing dispatch with indirect shader binding tables.
C Specification
To dispatch ray tracing, with some parameters sourced on the device, use:
void vkCmdTraceRaysIndirect2KHR(
VkCommandBuffer commandBuffer,
VkDeviceAddress indirectDeviceAddress);
Description
vkCmdTraceRaysIndirect2KHR behaves similarly to CmdTraceRaysIndirectKHR except that shader binding table parameters as well as dispatch dimensions are read by the device from indirectDeviceAddress during execution.
Valid Usage
- If a
VkSampler created with magFilter or minFilter equal to FILTER_LINEAR and compareEnable equal to FALSE is used to sample a VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
VkSampler created with mipmapMode equal to SAMPLER_MIPMAP_MODE_LINEAR and compareEnable equal to FALSE is used to sample a VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
VkImageView is sampled with depth comparison, the image view’s format features must contain FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
- If a
VkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a
DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must contain FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
- If a
VkImageView is sampled with FILTER_CUBIC_EXT as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- If the
VK_EXT_filter_cubic extension is not enabled and any VkImageView is sampled with FILTER_CUBIC_EXT as a result of this command, it must not have a VkImageViewType of IMAGE_VIEW_TYPE_3D, IMAGE_VIEW_TYPE_CUBE, or IMAGE_VIEW_TYPE_CUBE_ARRAY
- Any
VkImageView being sampled with FILTER_CUBIC_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubic returned by GetPhysicalDeviceImageFormatProperties2
- Any
VkImageView being sampled with FILTER_CUBIC_EXT with a reduction mode of either SAMPLER_REDUCTION_MODE_MIN or SAMPLER_REDUCTION_MODE_MAX as a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmax returned by GetPhysicalDeviceImageFormatProperties2
- If the
cubicRangeClamp feature is not enabled, then any VkImageView being sampled with FILTER_CUBIC_EXT as a result of this command
- must not have a
VkSamplerReductionModeCreateInfo
reductionMode equal to SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM
- Any
VkImageView being sampled with a VkSamplerReductionModeCreateInfo::reductionMode equal to SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM as a result of this command must sample with FILTER_CUBIC_EXT
- If the
selectableCubicWeights feature is not enabled, then any VkImageView being sampled with FILTER_CUBIC_EXT as a result of this command must have VkSamplerCubicWeightsCreateInfoQCOM::cubicWeights equal to CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM
- Any
VkImage created with a VkImageCreateInfo::flags containing IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must only be sampled using a VkSamplerAddressMode of SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For any
VkImageView being written as a storage image where the image format field of the OpTypeImage is Unknown, the view’s format features must contain FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- For any
VkImageView being read as a storage image where the image format field of the OpTypeImage is Unknown, the view’s format features must contain FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For any
VkBufferView being written as a storage texel buffer where the image format field of the OpTypeImage is Unknown, the view’s buffer features must contain FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- Any
VkBufferView being read as a storage texel buffer where the image format field of the OpTypeImage is Unknown then the view’s buffer features must contain FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For each set n that is statically used by a bound shader, a descriptor set must have been bound to n at the same pipeline bind point, with a
VkPipelineLayout that is compatible for set n, with the VkPipelineLayout or VkDescriptorSetLayout array that was used to create the current VkPipeline or VkShaderEXT, as described in Pipeline Layout Compatibility
- For each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a
VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout or VkDescriptorSetLayout and VkPushConstantRange arrays used to create the current VkPipeline or VkShaderEXT, as described in Pipeline Layout Compatibility
- If the
maintenance4 feature is not enabled, then for each push constant that is statically used by a bound shader, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout or VkDescriptorSetLayout and VkPushConstantRange arrays used to create the current VkPipeline or VkShaderEXT, as described in Pipeline Layout Compatibility
- Descriptors in each bound descriptor set, specified via
CmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command and the bound VkPipeline was not created with PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If the descriptors used by the
VkPipeline bound to the pipeline bind point were specified via CmdBindDescriptorSets, the bound VkPipeline must have been created without PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound descriptor buffers, specified via
CmdSetDescriptorBufferOffsetsEXT, must be valid if they are dynamically used by the VkPipeline bound to the pipeline bind point used by this command and the bound VkPipeline was created with PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound descriptor buffers, specified via
CmdSetDescriptorBufferOffsetsEXT, must be valid if they are dynamically used by any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command
- If the descriptors used by the
VkPipeline bound to the pipeline bind point were specified via CmdSetDescriptorBufferOffsetsEXT, the bound VkPipeline must have been created with PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If a descriptor is dynamically used with a
VkPipeline created with PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident
- If a descriptor is dynamically used with a
VkShaderEXT created with a VkDescriptorSetLayout that was created with DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident
- If the
shaderObject feature is not enabled, a valid pipeline must be bound to the pipeline bind point used by this command
- If the
shaderObject is enabled, either a valid pipeline must be bound to the pipeline bind point used by this command, or a valid combination of valid and NULL_HANDLE shader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command
- If a pipeline is bound to the pipeline bind point used by this command, there must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the
VkPipeline object bound to the pipeline bind point used by this command, since that pipeline was bound
- If the
VkPipeline object bound to the pipeline bind point used by this command or any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the type IMAGE_VIEW_TYPE_3D, IMAGE_VIEW_TYPE_CUBE, IMAGE_VIEW_TYPE_1D_ARRAY, IMAGE_VIEW_TYPE_2D_ARRAY or IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the
VkPipeline object bound to the pipeline bind point used by this command or any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stage
- If the
VkPipeline object bound to the pipeline bind point used by this command or any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stage
- If any stage of the
VkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, and that stage was created without enabling either PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT or PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT for uniformBuffers, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point
- If the
robustBufferAccess feature is not enabled, and any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point
- If any stage of the
VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, and that stage was created without enabling either PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT or PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT for storageBuffers, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point
- If the
robustBufferAccess feature is not enabled, and any VkShaderEXT bound to a stage corresponding to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point
- If
commandBuffer is an unprotected command buffer and protectedNoFault is not supported, any resource accessed by bound shaders must not be a protected resource
- If a bound shader accesses a
VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must only be used with OpImageSample* or OpImageSparseSample* instructions
- If a bound shader accesses a
VkSampler or VkImageView object that enables sampler Y′CBCR conversion, that object must not use the ConstOffset and Offset operands
- If a
VkImageView is accessed as a result of this command, then the image view’s viewType must match the Dim operand of the OpTypeImage as described in textures-operation-validation
- If a
VkImageView is accessed as a result of this command, then the numeric type of the image view’s format and the Sampled Type operand of the OpTypeImage must match
- If a
VkImageView created with a format other than FORMAT_A8_UNORM_KHR is accessed using OpImageWrite as a result of this command, then the Type of the Texel operand of that instruction must have at least as many components as the image view’s format
- If a
VkImageView created with the format FORMAT_A8_UNORM_KHR is accessed using OpImageWrite as a result of this command, then the Type of the Texel operand of that instruction must have four components
- If a
VkBufferView is accessed using OpImageWrite as a result of this command, then the Type of the Texel operand of that instruction must have at least as many components as the buffer view’s format
- If a
VkImageView with a VkFormat that has a 64-bit component width is accessed as a result of this command, the SampledType of the OpTypeImage operand of that instruction must have a Width of 64
- If a
VkImageView with a VkFormat that has a component width less than 64-bit is accessed as a result of this command, the SampledType of the OpTypeImage operand of that instruction must have a Width of 32
- If a
VkBufferView with a VkFormat that has a 64-bit component width is accessed as a result of this command, the SampledType of the OpTypeImage operand of that instruction must have a Width of 64
- If a
VkBufferView with a VkFormat that has a component width less than 64-bit is accessed as a result of this command, the SampledType of the OpTypeImage operand of that instruction must have a Width of 32
- If the
sparseImageInt64Atomics feature is not enabled, VkImage objects created with the IMAGE_CREATE_SPARSE_RESIDENCY_BIT flag must not be accessed by atomic instructions through an OpTypeImage with a SampledType with a Width of 64 by this command
- If the
sparseImageInt64Atomics feature is not enabled, VkBuffer objects created with the BUFFER_CREATE_SPARSE_RESIDENCY_BIT flag must not be accessed by atomic instructions through an OpTypeImage with a SampledType with a Width of 64 by this command
- If
OpImageWeightedSampleQCOM is used to sample a VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM
- If
OpImageWeightedSampleQCOM uses a VkImageView as a sample weight image as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM
- If
OpImageBoxFilterQCOM is used to sample a VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM
- If
OpImageBlockMatchSSDQCOM is used to read from an VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM is used to read from an VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM or OpImageBlockMatchSSDQCOM is used to read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation
- If
OpImageWeightedSampleQCOM, OpImageBoxFilterQCOM, OpImageBlockMatchWindowSSDQCOM, OpImageBlockMatchWindowSADQCOM, OpImageBlockMatchGatherSSDQCOM, OpImageBlockMatchGatherSADQCOM, OpImageBlockMatchSSDQCOM, or OpImageBlockMatchSADQCOM uses a VkSampler as a result of this command, then the sampler must have been created with SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If any command other than
OpImageWeightedSampleQCOM, OpImageBoxFilterQCOM, OpImageBlockMatchWindowSSDQCOM, OpImageBlockMatchWindowSADQCOM, OpImageBlockMatchGatherSSDQCOM, OpImageBlockMatchGatherSADQCOM, OpImageBlockMatchSSDQCOM, or OpImageBlockMatchSADQCOM uses a VkSampler as a result of this command, then the sampler must not have been created with SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM or OpImageBlockMatchGather*QCOM instruction is used to read from an VkImageView as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM or OpImageBlockMatchGather*QCOM instruction is used to read from an VkImageView as a result of this command, then the image view’s format must be a single-component format.
- If a
OpImageBlockMatchWindow*QCOM or OpImageBlockMatchGather*QCOM read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation
- Any shader invocation executed by this command must terminate
- Any shader group handle referenced by this call must have been queried from the currently bound ray tracing pipeline
- This command must not cause a shader call instruction to be executed from a shader invocation with a recursion depth greater than the value of
maxPipelineRayRecursionDepth used to create the bound ray tracing pipeline
commandBuffer must not be a protected command buffer
Valid Usage (Implicit)
commandBuffer must be a valid VkCommandBuffer handle
commandBuffer must be in the recording state
- The
VkCommandPool that commandBuffer was allocated from must support compute operations
- This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer must be externally synchronized
- Host access to the
VkCommandPool that commandBuffer was allocated from must be externally synchronized
Command Properties
- Parameters
- commandBuffer:VkCommandBuffer
the command buffer into which the command will be recorded.
- indirectDeviceAddress:long
a buffer device address which is a pointer to a VkTraceRaysIndirectCommand2KHR structure containing the trace ray parameters.
|