glslang icon indicating copy to clipboard operation
glslang copied to clipboard

Loading shadow texture causes spirv-val error

Open spencer-lunarg opened this issue 7 months ago • 4 comments

#version 450

layout (set = 0, binding = 0) uniform texture2D kTextures2DShadow[];
layout (set = 0, binding = 1) uniform samplerShadow kSamplersShadow[];

void main() {
    float x = texture(sampler2DShadow(kTextures2DShadow[0], kSamplersShadow[0]), vec3(0));
}

The following will produce a spirv-val error

error: line 48: Expected Image to have the same type as Result Type Image
  %29 = OpSampledImage %28 %19 %26

where the SPIR-V looks like

// Image
%9 = OpTypeImage %float 2D 0 0 0 1 Unknown
%19 = OpLoad %9 %18

// Result Type
%27 = OpTypeImage %float 2D 1 0 0 1 Unknown
%28 = OpTypeSampledImage %27

spencer-lunarg avatar Jul 11 '24 19:07 spencer-lunarg