Bug 29786

Summary: [glsl2] #pragma not supported
Product: Mesa Reporter: Ian Romanick <idr>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 28138    

Description Ian Romanick 2010-08-24 11:52:41 UTC
Neither the preprocessor nor the compiler proper support the #pragma directive in any form.  Several glslparsertest cases have been added to piglit to exercise this.  In addition, this bug is evident in the game Regnum Online (see bug #28138).

Since some of the #pragmas have rules about where they can be used, I believe the preprocessor should pass all *recognized* pragmas through, unmolested, to the compiler proper.  All of the actual processing should happen there.  Unrecognized pragmas should be removed.

The spec also says that pragmas are not subject to macro expansion, so we should probably add some tests for that.  Some expected-fail tests like the following should do the trick:

#define FOO on
#pragma debug(FOO)
Comment 1 Ian Romanick 2010-08-30 12:58:33 UTC
commit 33fe364e5aa7de3ce5f46077ff0868dcec4084bb
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Mon Aug 30 11:59:48 2010 -0700

    glsl2: Commit generated files changed by previous commit

commit bea3963f59fb8da0687c3e3fbc6f15de8be7fddb
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Mon Aug 30 11:58:04 2010 -0700

    glsl2: Parse #pragma lines
    
    All pragmas are currently ignored.  Also, the error messages when a
    pragma is used incorrectly (i.e., '#pragma debug(on)' inside a
    function) are crap, but I think this is sufficient for now.
    
    Fixes piglit test cases pragma-0[1-8].(vert|frag).

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.