glsl: move uniform calculation to link_uniforms
authorTapani Pälli <tapani.palli@intel.com>
Fri, 15 Jan 2016 11:11:20 +0000 (13:11 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 20 Jan 2016 05:24:39 +0000 (07:24 +0200)
commit4475d8f9169195baefa893b9b147fe20414cda7c
treeedff0980fea01e94d8cdab0386876325a43dea87
parent0a6a05c8eaeda570891fdece2d86e8e0b0e4d56f
glsl: move uniform calculation to link_uniforms

Patch moves uniform calculation to happen during link_uniforms, this
is possible with help of UniformRemapTable that has all the reserved
locations.

Location assignment for implicit locations is changed so that we
utilize also the 'holes' that explicit uniform location assignment
might have left in UniformRemapTable, this makes it possible to fit
more uniforms as previously we were lazy here and wasting space.

Fixes following CTS tests:
   ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max
   ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max-array

v2: code cleanups, increment NumUniformRemapTable correctly, fix
    find_empty_block to work properly and add some more comments.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
src/glsl/link_uniforms.cpp
src/glsl/linker.cpp
src/glsl/linker.h