Bug 25999

Summary: [GLSL] embedded structure constructor fails to compile
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: Mesa coreAssignee: Ian Romanick <idr>
Status: VERIFIED FIXED QA Contact:
Severity: major    
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 22:42:24 UTC
piglit/tests/glslparsertest/shaders/CorrectConstruct.vert:

struct s2 {
    float f;
    struct s3 {
       int i;
    } s3Inst;
} s2Inst = s2(1.0, s3(1));

gets Error: s3: undeclared function name


Similar error happens on CorrectConstFolding1.vert and CorrectConstFolding2.vert.


I can't find similar example in GLSL spec, but http://staffwww.itn.liu.se/~jimjo/courses/TNCG14-2009/documents/GLSLfeatures-110.pdf section 1.3 has this valid example (very similar to piglit cases):

struct light
{
    vec4 position;
    struct tLightColor
    {
        vec3 color;
        float intensity;
    } lightColor;
} light1 = light(v, tLightColor(color, 0.9));
Comment 1 Eric Anholt 2010-08-17 08:43:09 UTC
Fixed with glsl2 merge.
Comment 2 Gordon Jin 2010-08-18 19:41:34 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.