summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniform_query.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-08-01 18:39:21 -0700
committerIan Romanick <ian.d.romanick@intel.com>2014-08-07 16:17:48 -0700
commit8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c (patch)
treeeaca8ee992fe8679f2e3b5e826a1a760205172de /src/mesa/main/uniform_query.cpp
parent411abcb23751ff57de9843e992647a8e41daab75 (diff)
downloadexternal_mesa3d-8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c.zip
external_mesa3d-8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c.tar.gz
external_mesa3d-8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c.tar.bz2
mesa: Use MAX2 to calculate maximum uniform element
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r--src/mesa/main/uniform_query.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 7b089fa..2dc9f27 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -282,9 +282,7 @@ validate_uniform_parameters(struct gl_context *ctx,
* If not an array, check that array_index is zero.
* array_index is unsigned so no need to check for less than zero.
*/
- unsigned limit = uni->array_elements;
- if (limit == 0)
- limit = 1;
+ const unsigned limit = MAX2(uni->array_elements, 1);
if (*array_index >= limit) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(location=%d)",
caller, location);