Bug 28913 - [GLSL] allowing two version statements
Summary: [GLSL] allowing two version statements
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
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:
i915 platform:
i915 features:


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)

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)

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.