Bug 28913 - [GLSL] allowing two version statements
[GLSL] allowing two version statements
Status: VERIFIED FIXED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
All Linux (All)
: medium normal
Assigned To: mesa-dev
:
Depends on:
Blocks: 29044
  Show dependency treegraph
 
Reported: 2010-07-05 01:39 UTC by Gordon Jin
Modified: 2010-08-24 17:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Jin 2010-07-05 01:39:27 UTC
Both GLSL 1.10 and 1.20 specs say:
"The #version directive must occur in a shader before anything else, except for comments and white space."

But glsl/tests/glslparsertest/shaders/CorrectVersion1.V110.frag fails with below output:

Successfully compiled fragment shader /GFX/Test/Piglit_ext/piglit/tests/glslparsertest/shaders/CorrectVersion1.V110.frag: (no compiler output)

Output:
PIGLIT: {'result': 'fail' }


This piglit test case was changed as below with http://cgit.freedesktop.org/piglit/commit/?id=5752c9a33a66e91544a6af2e926833183318357b

/* Only one version statement is allowed; two should raise an error. */
#version 110
#version 110
Comment 1 Kenneth Graunke 2010-07-05 11:14:23 UTC
Right - this is fixed in the glsl2 branch.  Mesa master (incorrectly) allows this to pass, but the new compiler does not.
Comment 2 Gordon Jin 2010-08-24 17:13:54 UTC
verified in the latest mesa (after glsl2 merge)