Skip to content

RayTraversalPrimitiveCullingKHR capability not allowed in ray _query_ shaders #4278

@MarijnS95

Description

@MarijnS95

Describe the Issue

When using a shader with ray queries, that have SkipAABBsKHR set (RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES in HLSL) and its RayTraversalPrimitiveCullingKHR emitted in SPIR-V, the following error appears:

Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-01091 ] Object 0: handle = 0xb400007394d724d0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xa7bb8db6 | vkCreateShaderModule(): The SPIR-V Capability (RayTraversalPrimitiveCullingKHR) was declared, but none of the requirements were met to use it. The Vulkan spec states: If pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-01091)

Note that this appears when exclusively using VK_KHR_ray_query and not enabling/having VK_KHR_ray_tracing_pipeline - hence not enabling the flag in VkPhysicalDeviceRayTracingPipelineFeaturesKHR.

It appears the spec and this validation layer only have a Vulkan feature for Ray Tracing pipelines, but not for Ray Query shaders?

A possible workaround is passing VkPhysicalDeviceRayTracingPipelineFeaturesKHR regardless of the VK_KHR_ray_tracing_pipeline feature, but that seems wrong and I'm surprised the validation layer doesn't complain about feature structs being used without the appropriate extension being enabled.

Valid Usage ID

VUID-VkShaderModuleCreateInfo-pCode-01091

Environment

  • OS: Any
  • GPU: Any with Ray Query support
  • SDK or header version if building from repo: 1.3.216.0
  • Options enabled (synchronization, best practices, etc.): None.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions