Bug 25999 - [GLSL] embedded structure constructor fails to compile
Summary: [GLSL] embedded structure constructor fails to compile
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium major
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 29044
  Show dependency treegraph
 
Reported: 2010-01-11 22:42 UTC by Gordon Jin
Modified: 2010-08-18 19:41 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.