summaryrefslogtreecommitdiff
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
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 4ac062b42c..33ea664bcd 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);
}