SPIRV-Cross/shaders-msl/comp/image-atomic-automatic-bindings.comp
Hans-Kristian Arntzen b85ab5f5ff MSL: Fix automatic binding allocation for image atomic buffers.
The Primary decoration was used by the atomic buffer, causing the
texture binding to be potentially overlapping with other resources.
2019-11-28 11:07:44 +01:00

17 lines
397 B
Plaintext

#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);
}