Skip to content

Unexpected validation failure with a large location value. #6436

@dj2

Description

@dj2

We have a shader which has two input locations, one at 0 and one at 2^30. The validation fails with an error about conflicting locations.

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 17
; Schema: 0
               OpCapability Shader
               OpMemoryModel Logical GLSL450
               OpEntryPoint Fragment %man "man" %man_loc0_Input %man_loc1073741824_Input
               OpExecutionMode %man OriginUpperLeft
               OpName %man_loc0_Input "man_loc0_Input"
               OpName %man_loc1073741824_Input "man_loc1073741824_Input"
               OpName %man_inner "man_inner"
               OpName %v "v"
               OpName %v_1 "v_1"
               OpName %man "man"
               OpDecorate %man_loc0_Input Location 0
               OpDecorate %man_loc1073741824_Input Location 1073741824
               OpDecorate %man_loc1073741824_Input Flat
      %float = OpTypeFloat 32
%_ptr_Input_float = OpTypePointer Input %float
%man_loc0_Input = OpVariable %_ptr_Input_float Input
%man_loc1073741824_Input = OpVariable %_ptr_Input_float Input
       %void = OpTypeVoid
          %9 = OpTypeFunction %void %float %float
         %12 = OpTypeFunction %void
  %man_inner = OpFunction %void None %9
          %v = OpFunctionParameter %float
        %v_1 = OpFunctionParameter %float
         %10 = OpLabel
               OpReturn
               OpFunctionEnd
        %man = OpFunction %void None %12
         %13 = OpLabel
         %14 = OpLoad %float %man_loc0_Input None
         %15 = OpLoad %float %man_loc1073741824_Input None
         %16 = OpFunctionCall %void %man_inner %14 %15
               OpReturn
               OpFunctionEnd

This fails with:

1:1: [VUID-StandaloneSpirv-OpEntryPoint-08721] Entry-point has conflicting input location assignment at location 0, component 0
  OpEntryPoint Fragment %man "man" %man_loc0_Input %man_loc1073741824_Input

The VUID is:

Each OpEntryPoint must not have more than one Input variable assigned the same Component word inside a Location slot, either explicitly or implicitly

We're guessing that the location is multiplied by 4 to get the component which wraps around a u32 and gives the conflicting component location? If that's the case, should val be doing the multiplication in u64? (Or is there a maximum value we can put into the locations, as we thought it was 2^32 as the maximum location in SPIR-V?

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