Bug 26000 - [GLSL] allowing different parameter qualifier between the function definition and declaration
Summary: [GLSL] allowing different parameter qualifier between the function definition...
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Ian Romanick
QA Contact:
Depends on:
Blocks: 29044
  Show dependency treegraph
Reported: 2010-01-11 23:09 UTC by Gordon Jin
Modified: 2010-08-18 19:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Description Gordon Jin 2010-01-11 23:09:30 UTC
GLSL spec section 6.1 says:
"If functions' names and argument types match, then their return type and parameter qualifiers must also match."

But in piglit/tests/glslparsertest/shaders/function9.frag, the parameter qualifier in function declaration and definition doesn't match (note "const"), but it's compiled successfully: 

void function(const in int i);  

void main()
    int i;

// function definition has different parameter qualifiers than function declaration
void function(in int i)  
   i = 3;
Comment 1 Eric Anholt 2010-08-17 08:42:26 UTC
Fixed with the glsl2 merge.
Comment 2 Gordon Jin 2010-08-18 19:42:50 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.