Bug 28913

Summary: [GLSL] allowing two version statements
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: Mesa coreAssignee: mesa-dev
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: kenneth
Version: git   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 29044    

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)

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.