Bug 68753

Summary: [regression bisected] GLSL ES: structs members can't have precision qualifiers anymore in 9.2
Product: Mesa Reporter: Aras Pranckevicius <aras>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: idr, kenneth, mattst88
Version: 9.2   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Aras Pranckevicius 2013-08-30 13:45:30 UTC
ES fragment shader like this:

precision mediump float;
struct Foo { highp float a; };
void main() { gl_FragColor = vec4(0.0); }

Produces a compile error, "syntax error, unexpected HIGHP". This is output from glsl2 with "--es-shader".

Reproduces with mesa master (f7217b99f2437), 9.2 (9586f4de7). Works correctly in 9.1 (0dbbfa054c9).

My wild guess would be, regressed while doing all the geometry shader work?

Found while trying to pull mesa upstream into glsl-optimizer, caught by glsl optimizer test suite.
Comment 1 Ian Romanick 2013-08-30 19:58:08 UTC
Good guess, but it was actually the GL_ARB_shading_language_420pack work.  We also didn't have a test case for this, so I've sent one to the piglit mailing list.

git-bisect says:

commit 6eec502e84f2b4f6118544e78d2e97928618ba0f
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Jul 15 15:58:29 2013 -0700

    glsl: Move precision handling to be part of qualifier handling.
    
    This is necessary for the parser to be able to accept precision
    qualifiers not immediately adjacent to the type, such as "const highp
    inout float foo".
    
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
Comment 2 Ian Romanick 2013-08-30 21:26:14 UTC
I have a potential fix to send out as soon as a piglit run is done.
Comment 4 Aras Pranckevicius 2013-09-02 09:34:20 UTC
(In reply to comment #3)
> Patch sent:
> 
> http://lists.freedesktop.org/archives/mesa-dev/2013-August/044133.html

Fixes the problem for me, thanks!

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.