summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-06-15 12:57:20 +1200
committerChris Forbes <[email protected]>2014-06-26 07:58:32 +1200
commitb4ef7c596b31675aea131870ba4c07aaad1f1525 (patch)
treeaccb1faf2a5ed3ec408ee44249702a1381af030b /src/glsl/ast_to_hir.cpp
parent91b8ecbe1c134604fc87b3761a308b15a6caf394 (diff)
glsl: Treat an interface block specifier as a level of struct nesting
Fixes the piglit test: spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block-instanced.vert Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 92e0f90b81c..7ba04a808c2 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -5287,6 +5287,12 @@ ast_interface_block::hir(exec_list *instructions,
bool block_row_major = this->layout.flags.q.row_major;
exec_list declared_variables;
glsl_struct_field *fields;
+
+ /* Treat an interface block as one level of nesting, so that embedded struct
+ * specifiers will be disallowed.
+ */
+ state->struct_specifier_depth++;
+
unsigned int num_variables =
ast_process_structure_or_interface_block(&declared_variables,
state,
@@ -5298,6 +5304,8 @@ ast_interface_block::hir(exec_list *instructions,
redeclaring_per_vertex,
var_mode);
+ state->struct_specifier_depth--;
+
if (!redeclaring_per_vertex)
validate_identifier(this->block_name, loc, state);