[Bug 103895] Spurious “used uninitialized” warning

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 24 20:16:16 UTC 2017


            Bug ID: 103895
           Summary: Spurious “used uninitialized” warning
           Product: Mesa
           Version: 17.2
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/DRI/i965
          Assignee: intel-3d-bugs at lists.freedesktop.org
          Reporter: sgunderson at bigfoot.com
        QA Contact: intel-3d-bugs at lists.freedesktop.org


When compiling this GLSL compute shader:

#version 430

layout(local_size_x = 1) in;
uniform restrict writeonly image2D outbuf;


vec4 func() {
        return CS_OUTPUT_VAL;

void main()
        CS_OUTPUT_VAL = vec4(0.0, 0.0, 0.0, 1.0);
        vec4 val = func(); 
        imageStore(outbuf, ivec2(0, 0), val);

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

You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20171124/6c437463/attachment.html>

More information about the intel-3d-bugs mailing list