Bug 31925

Summary: [GLSL 1.20] "#pragma STDGL invariant(all)" fail
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: chadversary
Version: 7.10   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: test case for piglit shader_runner

Description Gordon Jin 2010-11-25 18:57:57 UTC
Created attachment 40577 [details]
test case for piglit shader_runner

GLSL spec 1.20 section 4.6.1 mentions all output variables can be forced to be invariant by:
    #pragma STDGL invariant(all)

but the attached test case shows it doesn't take effect, which fails with below error:

Failed to link:
error: vertex shader output `var' lacks invariant qualifier, but fragment shader input has invariant qualifier

PIGLIT: {'result': 'fail' }

Tested on Piketon (i965) with mesa master.
Comment 1 Vinson Lee 2010-11-25 21:30:16 UTC
I committed the attached test case (attachment id=40577) to piglit.
Comment 2 Ian Romanick 2011-01-06 10:58:07 UTC
Since the 7.9.1 and 7.10 releases are tomorrow, I'm going to wait to cherry pick these patches until after the release.

commit f2d0f776b17947f2e84a82444771faa853a76b8b
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Thu Jan 6 10:53:38 2011 -0800

    glsl: Refresh autogenerated lexer and parser files.
    
    For the previous commit.

commit 86b4398cd158024f6be9fa830554a11c2a7ebe0c
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Thu Jan 6 10:49:56 2011 -0800

    glsl: Support the 'invariant(all)' pragma
    
    Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
    simply ignored by the compiler.  This adds support for setting all
    variable invariant.
    
    In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
    but a warning is generated.
    
    Fixes piglit test glsl-invariant-pragma and bugzilla #31925.
    
    NOTE: This is a candidate for the 7.9 and 7.10 branches.
Comment 3 Ian Romanick 2011-01-27 12:28:59 UTC
Fixed by 77579801392c23d6fa425982dd8fa7cbdec2ca2e (7.9) and 6fded6d29d17b5402349881350fe92c175cbdc43 (7.10).
Comment 4 Gordon Jin 2011-02-11 21:56:32 UTC
verified.

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.