[Mesa-dev] [PATCH] glsl: Track UBO block names in the symbol table.
Kenneth Graunke
kenneth at whitecape.org
Sat Dec 8 21:49:28 PST 2012
On 12/08/2012 12:45 PM, Ian Romanick wrote:
> From: Kenneth Graunke <kenneth at whitecape.org>
>
> 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.
>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> src/glsl/ast_to_hir.cpp | 6 ++++++
> src/glsl/glsl_symbol_table.cpp | 14 +++++++++++---
> src/glsl/glsl_symbol_table.h | 1 +
> 3 files changed, 18 insertions(+), 3 deletions(-)
I'm fine with pushing this, but I wasn't sure whether using the struct
gl_uniform_block in this way was going to be irritating when trying to
implement blocks with instance names.
But I suppose it can always be reworked.
More information about the mesa-dev
mailing list