Bug 26000

Summary: [GLSL] allowing different parameter qualifier between the function definition and declaration
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: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 29044    

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(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.