mesa: Rework array error checks in validate_uniform_parameters
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 20 Oct 2014 23:40:50 +0000 (16:40 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 10 Nov 2014 12:25:40 +0000 (04:25 -0800)
commit91a2fa1490b86b11430db6a604dc28bac1871695
tree03608f7b7928cdde3aaa695e8ae65091ab5133ca
parent366540e9af86edc7451beb39204efbb4fe593973
mesa: Rework array error checks in validate_uniform_parameters

Before ARB_explicit_uniform_location, Mesa's location encoding allowed
locations for non-array types that had non-zero array indices.
Basically, part of the location was the uniform and part was the array
index.  This meant that some checks had to occur for arrays and
non-arrays.  This is no longer possible, we the checks can be split up.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (64-bit):       50,499,557      17,487,316           686,227
After  (64-bit):       50,023,791      17,274,432           684,293

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (32-bit):       62,968,039       21,732,380          828,147
After  (32-bit):       62,373,967       21,490,756          826,223

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/uniform_query.cpp