Closed spencer-lunarg closed 1 month ago
I experience this with the new Vulkan SDK 1.3.290 while running the Tiny_MeshLarge demo from https://github.com/corporateshark/lightweightvk.
After updating to Vulkan SDK 1.3.290, we also started to see the same validation error.
Here is a simple HLSL shader that triggers this problem:
Texture2D<float> g_ShadowMap;
SamplerComparisonState g_ShadowMap_sampler;
float SampleShadow(Texture2D<float> ShadowMap)
{
return ShadowMap.SampleCmp(g_ShadowMap_sampler, float2(0.5, 0.5), 0.0).r;
}
float4 main() : SV_TARGET
{
float Shadow = SampleShadow(g_ShadowMap);
return float4(Shadow, Shadow, Shadow, 1.0);
}
@spencer-lunarg What should glslang be doing here? I believe your example is valid GLSL, but what is the expected SPIR-V that should be output in such a case so as to not cause validation issues?
- %9 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %9 = OpTypeImage %float 2D 1 0 0 1 Unknown
because the OpLoad
for texture(sampler2DShadow(...))
should have a Depth
operand of 1
https://gitlab.khronos.org/vulkan/vulkan/-/issues/3993 https://github.com/KhronosGroup/SPIRV-Tools/issues/5781
so this has been causing issues everywhere, will wait to see how things are resolved
@arcady-lunarg closing with https://github.com/KhronosGroup/SPIRV-Tools/pull/5789 now merged
The following will produce a spirv-val error
where the SPIR-V looks like