diff options
author | Ian Romanick <[email protected]> | 2013-01-21 23:01:33 -0500 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-25 09:07:34 -0500 |
commit | 5383661092fc46cf7013052210e6d624f4d5b596 (patch) | |
tree | 0997c7806b795f6db0e75395edf752c5e605331b /src/glsl/ast_to_hir.cpp | |
parent | 9a204bb9f611e34396ea838b44517dd6eeb99bcc (diff) |
glsl: Track blocks in the symbol table using the glsl_type instead of the gl_uniform_block
Eventually the gl_uniform_block information won't be calculated until
linking. Block names need to be checked for name clashes during
compiling, so we have to track it differently.
v2: Update the commit message. Suggested by Carl Worth.
Signed-off-by: Ian Romanick <[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.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index e2d7265a6a2..80a02e9da4e 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -4219,12 +4219,6 @@ ast_uniform_block::hir(exec_list *instructions, struct gl_uniform_block *ubo = get_next_uniform_block(state); ubo->Name = ralloc_strdup(state->uniform_blocks, this->block_name); - if (!state->symbols->add_uniform_block(ubo)) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "Uniform block name `%s' already taken in " - "the current scope.\n", ubo->Name); - } - if (this->layout.flags.q.shared) { ubo->_Packing = ubo_packing_shared; } else if (this->layout.flags.q.packed) { @@ -4260,6 +4254,12 @@ ast_uniform_block::hir(exec_list *instructions, (enum glsl_interface_packing) ubo->_Packing, this->block_name); + if (!state->symbols->add_type(block_type->name, block_type)) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(&loc, state, "Uniform block name `%s' already taken in " + "the current scope.\n", this->block_name); + } + /* Since interface blocks cannot contain statements, it should be * impossible for the block to generate any instructions. */ |