SPIRV-Cross/reference/shaders-no-opt/asm/comp/access-chain-dominator-in-loop-body.asm.comp
Hans-Kristian Arntzen e23c9ea700 Force complex loop in certain rare access chain scenarios.
If we generate an access chain in a loop body, and it is consumed in the
loop continue block, we have a problem because we cannot emit a
temporary here holding the access chain reference. Force a complex loop
body to workaround this exceptionally rare case.
2019-04-10 16:02:03 +02:00

28 lines
432 B
Plaintext

#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer SSBO
{
int values[];
} _4;
void main()
{
int _17 = 0;
for (;;)
{
if (_17 < 100)
{
int _24 = _4.values[_17];
_4.values[_24] = _17;
_17 = _4.values[_24 + 1];
continue;
}
else
{
break;
}
}
}