On 12/08/2012 09:49 PM, Kenneth Graunke wrote:
On 12/08/2012 12:45 PM, Ian Romanick wrote:
From: Kenneth Graunke <kenn...@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.roman...@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.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to