[Bug 88815] New: Incorrect handling of GLSL #line directive

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 26 16:17:48 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=88815

            Bug ID: 88815
           Summary: Incorrect handling of GLSL #line directive
           Product: Mesa
           Version: 10.1
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: glsl-compiler
          Assignee: idr at freedesktop.org
          Reporter: willusher.life at gmail.com
        QA Contact: intel-3d-bugs at lists.freedesktop.org

Hey all, I've noticed a bug in Mesa's treatment of the #line directive in GLSL
3.3+.

The 3.3 spec changed the line number set by #line to be the line number for the
following line of source (pg 11 GLSL 3.3 spec):

    #line `line`
    #line `line` `source-string-number`

> After processing this directive (including its new-line), the implementation  
> will behave as if it is compiling at line number `line` and source string
> number `source-string-number`. Subsequent source strings will be numbered
> sequentially, until another #line directive overrides that numbering.

So for a shader with some silly error in it:

    #version 330 core
    #line 1 4
    not_valid vec4 thingy_error;
    #line 1 0
    layout(location = 0) in vec4 pos;
    void main(void){
        gl_Position = pos;
    }

We'd expect the error to specify something about the incorrect identifier/token
w/e on line 1 of source string 4, however Mesa's compilation log contains the
following:

> 0:2(1): error: syntax error, unexpected NEW_IDENTIFIER

>From some other shader compilers it seems like the first number refers to the
source string number, which should be 4 here. The compiler also seems to be
using the GLSL 1.5 line directive where the following line is line number
`line` + 1.

Nvidia's compiler gives the expected source string number and line number:

> 4(1) : warning C7022: unrecognized profile specifier "not_valid"
> 4(1) : error C0502: syntax error at token "not_valid"

Information about my Mesa & GL version:

> OpenGL Version: 3.3 (Core Profile) Mesa 10.1.3
> OpenGL Vendor: Intel Open Source Technology Center
> OpenGL Renderer: Mesa DRI Intel(R) Ivybridge Mobile 
> GLSL Version: 3.30

Thanks!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150127/9eee8e74/attachment.html>


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