SPIRV-Cross/reference/shaders-hlsl-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

25 lines
469 B
Plaintext

RWByteAddressBuffer _5 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
uint _24;
_5.InterlockedAdd(0, 1u, _24);
if (_24 < 1024u)
{
_5.Store(_24 * 4 + 4, gl_GlobalInvocationID.x);
}
}
[numthreads(1, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}