linker: Set block bindings based on UniformBlocks rather than UniformStorage
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 4 Apr 2014 19:46:01 +0000 (12:46 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 11 Apr 2014 19:26:01 +0000 (12:26 -0700)
commitcc42717b50bd46c82ac7925c397cd105ac82d091
tree5240649d1619c20888b06fc7c1fba8ea67ed94b0
parent157391a41bc3e0222888d0450405867139ab4c9d
linker: Set block bindings based on UniformBlocks rather than UniformStorage

For blocks, gl_shader_program::UniformStorage isn't very useful.  The
names stored there are the names of the elements of the block, so
finding blocks with an instance name is hard.  There is also only one
entry in ::UniformStorage for each element of a block array, and that is
a deal breaker.

Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does.  I
contemplated sharing code between set_block_binding and
_mesa_GetUniformBlockIndex, but building the stand-alone compiler and
the unit tests make this hard.  I plan to return to this effort shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
src/glsl/link_uniform_initializers.cpp