SPIRV-Cross/reference/opt/shaders/frag/selection-block-dominator.frag
Hans-Kristian Arntzen fc9fe4e480 Fix variable scope when an if or else block dominates a variable.
Just like loops, we need complicated hoisting again to make this work.
2019-07-03 11:18:50 +02:00

20 lines
285 B
GLSL

#version 450
layout(location = 0) flat in int vIndex;
layout(location = 0) out vec4 FragColor;
void main()
{
for (;;)
{
if (vIndex != 1)
{
FragColor = vec4(1.0);
break;
}
FragColor = vec4(10.0);
break;
}
}