Debian Codegraph @

third_party/spirv-cross/shaders-msl/comp/image-atomic-automatic-bindings.argument.msl2.comp

raw
1 #version 450
2 layout(local_size_x = 1) in;
3
4 layout(set = 0, binding = 0, r32ui) uniform uimage2D uImage;
5 layout(set = 0, binding = 1) uniform sampler2D uTexture;
6
7 layout(set = 0, binding = 2) buffer SSBO
8 {
9 vec4 outdata;
10 };
11
12 void main()
13 {
14 uint ret = imageAtomicAdd(uImage, ivec2(gl_GlobalInvocationID.xy), 10u);
15 outdata = textureLod(uTexture, vec2(gl_GlobalInvocationID.xy), 0.0) + float(ret);
16 }