Spurious “used uninitialized” warning
Submitted by Steinar H. Gunderson
Assigned to mes..@..op.org
Link to original bug (#103895)
Description
Hi,
When compiling this GLSL compute shader:
=== #version 430
layout(local_size_x = 1) in; uniform restrict writeonly image2D outbuf;
vec4 CS_OUTPUT_VAL;
vec4 func() { return CS_OUTPUT_VAL; }
CS_OUTPUT_VAL = vec4(0.0, 0.0, 0.0, 1.0);
vec4 val = func();
imageStore(outbuf, ivec2(0, 0), val);
}
void main()
{I get this warning:
Shader compile log: 0:9(9): warning: `CS_OUTPUT_VAL' used uninitialized
If I move func() below main() (with a forward declaration), the warning goes away.
Version: 17.2