Bug 25808

Summary: [GLSL] const variable is modified successfully
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: Mesa coreAssignee: Ian Romanick <idr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: brianp
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 29044    

Description Gordon Jin 2009-12-28 00:47:25 UTC
piglit/tests/glslparsertest/shaders/function3.frag expects to be compiled fail
because it writes to a "const" variable (which is defined as read-only in GLSL
spec):

void function(const int i)  
{
    i = 3;  // const value cant be modified
}


But it gets compiled successfully in mesa.
Comment 1 Gordon Jin 2010-01-11 21:54:07 UTC
piglit/tests/glslparsertest/shaders/struct9.frag fails with similar issue:

const struct s {
    int i;
} s1 = s(1);

void main()
{
   s1.i = 1;  // const struct members cannot be modified
}
Comment 2 Eric Anholt 2010-08-17 09:12:52 UTC
Fixed with glsl2 merge.
Comment 3 Gordon Jin 2010-08-18 19:23:59 UTC
verified with mesa master d442a01ac14382d83cdaac87d2832315ceb3e963

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.