summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-09-18 11:11:09 +0200
committerKenneth Graunke <[email protected]>2010-09-18 11:21:34 +0200
commitca92ae2699c4aad21c0811b9a5562b9223816caf (patch)
tree085a3e995c8a84274febcb4d6a466337ecaaff89 /src/glsl/glsl_parser_extras.cpp
parentcef42f925cc8b38df741c4571676dab4bd3fd14e (diff)
glsl: Properly handle nested structure types.
Fixes piglit test CorrectFull.frag.
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 4ac062b42c1..33ea664bcd8 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -680,6 +680,11 @@ ast_struct_specifier::print(void) const
ast_struct_specifier::ast_struct_specifier(char *identifier,
ast_node *declarator_list)
{
+ if (identifier == NULL) {
+ static unsigned anon_count = 1;
+ identifier = talloc_asprintf(this, "#anon_struct_%04x", anon_count);
+ anon_count++;
+ }
name = identifier;
this->declarations.push_degenerate_list_at_head(&declarator_list->link);
}