glsl: Fix uniform buffer object counting. 70/6870/1
authorEric Anholt <eric@anholt.net>
Thu, 23 May 2013 18:10:15 +0000 (11:10 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 6 Jun 2013 21:37:41 +0000 (14:37 -0700)
commit38e77e545d06bf5ac0e185f2a1581a97bafdab56
treea907d7de6f8cc8080539f21f90e04464089e5784
parent93c8692ce92d396f0a4db5bc91d8e7322fa7dd50
glsl: Fix uniform buffer object counting.

We were counting uniforms located in UBOs against the default uniform
block limit, while not doing any counting against the specific combined
limit.

Note that I couldn't quite find justification for the way I did this, but
I think it's the only sensible thing: The spec talks about components, so
each "float" in a std140 block would count as 1 component and a "vec4"
would count as 4, though they occupy the same amount of space.  Since GPU
limits on uniform buffer loads are surely going to be about the size of
the blocks, I just counted them that way.

Fixes link failures in piglit
arb_uniform_buffer_object/maxuniformblocksize when ported to geometry
shaders on Paul's GS branch, since in that case the max block size is
bigger than the default uniform block component limit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/link_uniforms.cpp
src/glsl/linker.cpp
src/mesa/main/mtypes.h