Description
When using a globallycoherent RWTexture and the Vulkan memory model via -fspv-use-vulkan-memory-model, the generated SPIR-V is invalid. When the default GLSL450 memory model is used, the code compiles correctly.
Coherent structured buffers don't seem to be affected.
Steps to Reproduce
https://godbolt.org/z/sGYzc8KW4
// -T ps_6_6 -E main -spirv -HV 2021 -fspv-target-env=vulkan1.3 -fspv-use-vulkan-memory-model
// Does not compile if vulkan memory model is requested
[[vk::binding(0, 0)]] globallycoherent RWTexture2D<float4> img;
struct PSInput {
float4 position : SV_Position;
};
float4 main(PSInput input) : SV_Target0 {
return img[uint2(input.position.xy)];
}
Actual Behavior
fatal error: generated SPIR-V is invalid: NonPrivatePointerKHR requires a pointer in Uniform, Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer storage classes.
%22 = OpLoad %type_2d_image %img MakePointerVisible|NonPrivatePointer %uint_5
Environment
Description
When using a globallycoherent RWTexture and the Vulkan memory model via
-fspv-use-vulkan-memory-model, the generated SPIR-V is invalid. When the default GLSL450 memory model is used, the code compiles correctly.Coherent structured buffers don't seem to be affected.
Steps to Reproduce
https://godbolt.org/z/sGYzc8KW4
Actual Behavior
fatal error: generated SPIR-V is invalid: NonPrivatePointerKHR requires a pointer in Uniform, Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer storage classes.%22 = OpLoad %type_2d_image %img MakePointerVisible|NonPrivatePointer %uint_5Environment