Skip to content

spirv-val seems to be overly strict with subgroup builtins #6860

Description

@wingertge

I recently switched to builtin structs but am now getting validation errors for SubgroupLocalInvocationId.

Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08737 ] | MessageID = 0xa5625282
vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
BuiltIn SubgroupLocalInvocationId cannot be used as a member decoration
  %_struct_18 = OpTypeStruct %uint %uint

Command to reproduce:
        spirv-val <input.spv> --relax-block-layout --uniform-buffer-standard-layout --workgroup-scalar-block-layout --allow-localsizeid --allow-offset-texture-operand --allow-vulkan-32-bit-bitwise --target-env vulkan1.3

The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08737)

I traced the code path to the code introduced in this PR 7 years ago.
I cannot find any validation rule for this, and there is no VUID attached.

The simple fix would be to remove the check that disallows member decorations, but I'd like to make sure I didn't somehow miss the rule that requires this first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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