SPIRV-Cross/shaders-no-opt/frag/variables.zero-initialize.frag
Hans-Kristian Arntzen b8905bbd95 Add support for forcefully zero-initialized variables.
Useful to better support certain platforms which require all variables
to be initialized to something.
2020-03-26 13:38:27 +01:00

22 lines
338 B
GLSL

#version 450
layout(location = 0) in vec4 vColor;
layout(location = 0) out vec4 FragColor;
int uninit_int;
ivec4 uninit_vector;
mat4 uninit_matrix;
struct Foo { int a; };
Foo uninit_foo;
void main()
{
int uninit_function_int;
if (vColor.x > 10.0)
uninit_function_int = 10;
else
uninit_function_int = 20;
FragColor = vColor;
}