Bug 103895 - Spurious “used uninitialized” warning
Summary: Spurious “used uninitialized” warning
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 17.2
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 20:16 UTC by Steinar H. Gunderson
Modified: 2017-11-25 08:30 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steinar H. Gunderson 2017-11-24 20:16:16 UTC
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;
}

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 away.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.