Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spirv-val does not validate Flat decoration requirement for builtins #3154

Closed
HansKristian-Work opened this issue Jan 27, 2020 · 4 comments · Fixed by #4831
Closed

spirv-val does not validate Flat decoration requirement for builtins #3154

HansKristian-Work opened this issue Jan 27, 2020 · 4 comments · Fixed by #4831
Assignees

Comments

@HansKristian-Work
Copy link
Contributor

This SPIR-V passes validation, even if Flat is removed from Layer Builtin input in fragment shader:

; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
               OpCapability Shader
               OpCapability Geometry
          %1 = OpExtInstImport "GLSL.std.450"
               OpMemoryModel Logical GLSL450
               OpEntryPoint Fragment %main "main" %layer %gl_Layer
               OpExecutionMode %main OriginUpperLeft
               OpSource GLSL 450
               OpName %main "main"
               OpName %layer "layer"
               OpName %gl_Layer "gl_Layer"
               OpDecorate %layer Location 0
               ;OpDecorate %gl_Layer Flat
               OpDecorate %gl_Layer BuiltIn Layer
       %void = OpTypeVoid
          %3 = OpTypeFunction %void
        %int = OpTypeInt 32 1
%_ptr_Output_int = OpTypePointer Output %int
      %layer = OpVariable %_ptr_Output_int Output
%_ptr_Input_int = OpTypePointer Input %int
   %gl_Layer = OpVariable %_ptr_Input_int Input
       %main = OpFunction %void None %3
          %5 = OpLabel
         %11 = OpLoad %int %gl_Layer
               OpStore %layer %11
               OpReturn
               OpFunctionEnd
@alan-baker
Copy link
Contributor

Can you point to this language in the spec? I don't see this requirement in either SPIR-V or Vulkan.

@HansKristian-Work
Copy link
Contributor Author

Vulkan spec, 8.11: "Fragment shader inputs that are signed or unsigned integers, integer vectors, or any double-
precision floating-point type must be decorated with Flat."

@sfricke-samsung
Copy link
Contributor

Internal Vulkan MR 4368 to add to spec as well

@sfricke-samsung sfricke-samsung self-assigned this Feb 2, 2021
@sfricke-samsung
Copy link
Contributor

Also realize this is a duplicate of #3066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants