glsl: Track UBO block names in the symbol table.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 28 Nov 2012 08:18:02 +0000 (00:18 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 19 Jan 2013 01:35:32 +0000 (17:35 -0800)
commit4f29169913f99252c54e1922f6d164e2ef530a58
treee857b0a5384f67880afc06ffa8c3139e8452a272
parentbb47a4d081c383a2c42555c2bbde2f5d8ee2412c
glsl: Track UBO block names in the symbol table.

The GLSL 1.40 spec says:

    "Uniform block names and variable names declared within uniform
    blocks are scoped at the program level."

Track the block name in the symbol table and emit errors when conflicts
exist.

Fixes es3conform's uniform_buffer_object_block_name_conflict test, and
fixes the piglit block-name-clashes-with-{variable,function,struct}.vert
tests.

NOTE: This is a candidate for the 9.0 branch.

v2: Fix bad constructor initialization.  Noticed by Topi Pohjolainen.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp
src/glsl/glsl_symbol_table.cpp
src/glsl/glsl_symbol_table.h