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

SPIR-V Validation Errors when using Vulkan Relaxed Rules #3549

Open
RozeFound opened this issue Mar 20, 2024 · 0 comments
Open

SPIR-V Validation Errors when using Vulkan Relaxed Rules #3549

RozeFound opened this issue Mar 20, 2024 · 0 comments
Labels
relaxed Issues involving GL_EXT_vulkan_glsl_relaxed

Comments

@RozeFound
Copy link

RozeFound commented Mar 20, 2024

Somehow it generates this error

error: [VUID-StandaloneSpirv-Flat-04744] Fragment OpEntryPoint operand 22 with Input interfaces with integer or float type must have a Flat decoration for Entry Point id 4.
  %gl_VertexIndex = OpVariable %_ptr_Input_int Input

Fragment Shader

#version 450

precision highp float;

in vec2 fragTexCoord;

uniform sampler2D texSampler;

out vec4 diffuseColor;

void main() {
  diffuseColor = texture(texSampler, fragTexCoord);
}

Assembly generated

; SPIR-V
; Version: 1.6
; Generator: Khronos Glslang Reference Front End; 11
; Bound: 24
; Schema: 0
               OpCapability Shader
          %1 = OpExtInstImport "GLSL.std.450"
               OpMemoryModel Logical GLSL450
               OpEntryPoint Fragment %main "main" %diffuseColor %texSampler %fragTexCoord %gl_VertexIndex %gl_InstanceIndex
               OpExecutionMode %main OriginUpperLeft
               OpSource GLSL 450
               OpName %main "main"
               OpName %diffuseColor "diffuseColor"
               OpName %texSampler "texSampler"
               OpName %fragTexCoord "fragTexCoord"
               OpName %gl_VertexIndex "gl_VertexIndex"
               OpName %gl_InstanceIndex "gl_InstanceIndex"
               OpDecorate %diffuseColor Location 0
               OpDecorate %texSampler DescriptorSet 0
               OpDecorate %texSampler Binding 1
               OpDecorate %fragTexCoord Location 0
               OpDecorate %gl_VertexIndex BuiltIn VertexIndex
               OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
       %void = OpTypeVoid
          %3 = OpTypeFunction %void
      %float = OpTypeFloat 32
    %v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%diffuseColor = OpVariable %_ptr_Output_v4float Output
         %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
         %11 = OpTypeSampledImage %10
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
 %texSampler = OpVariable %_ptr_UniformConstant_11 UniformConstant
    %v2float = OpTypeVector %float 2
%_ptr_Input_v2float = OpTypePointer Input %v2float
%fragTexCoord = OpVariable %_ptr_Input_v2float Input
        %int = OpTypeInt 32 1
%_ptr_Input_int = OpTypePointer Input %int
%gl_VertexIndex = OpVariable %_ptr_Input_int Input
%gl_InstanceIndex = OpVariable %_ptr_Input_int Input
       %main = OpFunction %void None %3
          %5 = OpLabel
         %14 = OpLoad %11 %texSampler
         %18 = OpLoad %v2float %fragTexCoord
         %19 = OpImageSampleImplicitLod %v4float %14 %18
               OpStore %diffuseColor %19
               OpReturn
               OpFunctionEnd
@RozeFound RozeFound changed the title Spriv Validation Errors when using Vulkan Relaxed Rules SPIR-V Validation Errors when using Vulkan Relaxed Rules Mar 26, 2024
@arcady-lunarg arcady-lunarg added the relaxed Issues involving GL_EXT_vulkan_glsl_relaxed label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relaxed Issues involving GL_EXT_vulkan_glsl_relaxed
Projects
None yet
Development

No branches or pull requests

2 participants