SPIRV-Cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag
Hans-Kristian Arntzen 5d97dae1eb Move branchless analysis to CFG.
Traverse backwards instead, far more robust. Should elide basically all
redundant continue; statements now.
2019-08-27 10:19:19 +02:00

22 lines
350 B
GLSL

#version 450
layout(location = 0) out vec4 FragColor;
layout(location = 0) in vec4 v0;
void main()
{
FragColor = vec4(1.0);
for (int _54 = 0; _54 < 4; _54++)
{
if (v0.x == 20.0)
{
FragColor += vec4(v0[_54 & 3]);
}
else
{
FragColor += vec4(v0[_54 & 1]);
}
}
}