[Mesa-dev] [PATCH] glsl: Track UBO block names in the symbol table.
Ian Romanick
idr at freedesktop.org
Mon Dec 10 13:54:18 PST 2012
On 12/08/2012 09:49 PM, Kenneth Graunke wrote:
> 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.
I don't know if this is how the code will ultimately work. However,
this is a simple enough fix that it can be picked back to the 9.0 branch
without worries. There's going to be a lot of churn in this area, so I
don't think any later code would be able to be picked back.
More information about the mesa-dev
mailing list