SPIRV-Cross/reference/opt/shaders/asm/frag/single-function-private-lut.asm.frag
Hans-Kristian Arntzen 3e584f2c3f Support LUTs in single-function CFGs on Private storage class.
Fairly common pattern in unoptimized SPIR-V. Support this case as well.
2019-02-06 10:38:59 +01:00

24 lines
381 B
GLSL

#version 460
struct myType
{
float data;
};
const myType _21[5] = myType[](myType(0.0), myType(1.0), myType(0.0), myType(1.0), myType(0.0));
layout(location = 0) out vec4 o_color;
void main()
{
if (_21[int(mod(gl_FragCoord.x, 4.0))].data > 0.0)
{
o_color = vec4(0.0, 1.0, 0.0, 1.0);
}
else
{
o_color = vec4(1.0, 0.0, 0.0, 1.0);
}
}