$ glslangValidator --version
Glslang Version: 8.13.3559
ESSL Version: OpenGL ES GLSL 3.20 glslang Khronos. 13.3559
GLSL Version: 4.60 glslang Khronos. 13.3559
SPIR-V Version 0x00010400, Revision 1
GLSL.std.450 Version 100, Revision 1
Khronos Tool ID 8
SPIR-V Generator Version 8
GL_KHR_vulkan_glsl version 100
ARB_GL_gl_spirv version 100
The compilation fails when spirv-opt is invoked with the following message:
error: line 51: AtomicIAdd: expected Value to be of type Result Type
%25 = OpAtomicIAdd %uint %21 %uint_1 %uint_0 %int_1
I'm not sure if this problem comes from glslang or spirv-opt, maybe you guys have more info on this.
As a reference, here is what dxc outputs at the atomic instruction for my example:
Here's my repro case:
This shader compiles to SPIR-V with the following command:
The compilation fails when
spirv-opt
is invoked with the following message:I'm not sure if this problem comes from
glslang
orspirv-opt
, maybe you guys have more info on this. As a reference, here is whatdxc
outputs at the atomic instruction for my example:EDIT: So I slept on it and tried to force constants to the
uint
type. Here's the changed part:This successfully compiles with
glslang
. I still think there's a bug here though.