SPIRV-Cross/reference/shaders/asm/frag/temporary-phi-hoisting.asm.frag
Hans-Kristian Arntzen 0fd028147f Hoist all phi-local variables to entry block.
We don't have a mechanism to move temporaries to their appropriate
scope, and Phi behavior is weird enough that it will be a heroic effort
to not do this rather ugly codegen :(
2017-11-23 09:50:11 +01:00

30 lines
450 B
GLSL

#version 450
struct MyStruct
{
vec4 color;
};
layout(std140) uniform MyStruct_CB
{
MyStruct g_MyStruct[4];
} _6;
layout(location = 0) out vec4 _entryPointOutput;
void main()
{
vec3 _14;
vec3 _29;
int _16;
int _32;
vec3 _28;
_28 = vec3(0.0);
for (int _31 = 0; _31 < 4; _32 = _31 + 1, _28 = _29, _31 = _32)
{
_29 = _28 + _6.g_MyStruct[_31].color.xyz;
}
_entryPointOutput = vec4(_28, 1.0);
}