Bug 25808 - [GLSL] const variable is modified successfully
Summary: [GLSL] const variable is modified successfully
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact:
Depends on:
Blocks: 29044
  Show dependency treegraph
Reported: 2009-12-28 00:47 UTC by Gordon Jin
Modified: 2010-08-18 19:23 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


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

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.