SPIRV-Cross/shaders-msl/comp/image-atomic-automatic-bindings.argument.msl2.comp

17 lines
397 B
Plaintext
Raw Normal View History

#version 450
layout(local_size_x = 1) in;
layout(set = 0, binding = 0, r32ui) uniform uimage2D uImage;
layout(set = 0, binding = 1) uniform sampler2D uTexture;
layout(set = 0, binding = 2) buffer SSBO
{
vec4 outdata;
};
void main()
{
uint ret = imageAtomicAdd(uImage, ivec2(gl_GlobalInvocationID.xy), 10u);
outdata = textureLod(uTexture, vec2(gl_GlobalInvocationID.xy), 0.0) + float(ret);
}