SPIRV-Cross/reference/shaders-no-opt/asm/comp/atomic-result-temporary.asm.comp
Hans-Kristian Arntzen 8b236f24f1 Fix infinite loop when OpAtomic* temporaries are used in other blocks.
We made the mistake of registering a dependency on the atomic variable
even if the atomic result was forced to a temporary. There is no need to
register reads from atomic variables like this as we always force atomic
results to a temporary and argument read/writes do not need to be
tracked.
2019-04-24 09:33:39 +02:00

19 lines
299 B
Plaintext

#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer SSBO
{
uint count;
uint data[];
} _5;
void main()
{
uint _24 = atomicAdd(_5.count, 1u);
if (_24 < 1024u)
{
_5.data[_24] = gl_GlobalInvocationID.x;
}
}