mesa: Rework location == -1 error checking
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 20 Oct 2014 23:21:54 +0000 (16:21 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 10 Nov 2014 12:25:39 +0000 (04:25 -0800)
commit3f5ebb98b74cca8488ee7093aab87125ee5341ed
treed4653a6cb734d5d627d23826570e832bef1505e4
parent23dcbf623f55fedb92d232b2b3e196834c8a1f2e
mesa: Rework location == -1 error checking

Only one caller wanted to generate an error when location == -1, so move
the error generation to that caller.  There will be more callers in the
future that do not want to generate errors.

Move the location == -1 check later in validate_uniform_parameters.  As
currently implemented, glUniform1iv(-1, -1, data) would not generate an
error, but it should due to count being < 0.

The location that I have moved it to will make more sense with the next
commit.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (64-bit):       51,241,217      17,740,162           689,181
After  (64-bit):       50,499,557      17,487,316           686,227

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (32-bit):       63,940,605       21,987,918          831,065
After  (32-bit):       62,968,039       21,732,380          828,147

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