diff options
author | Ian Romanick <[email protected]> | 2014-08-01 18:39:21 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-08-07 16:17:48 -0700 |
commit | 8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c (patch) | |
tree | eaca8ee992fe8679f2e3b5e826a1a760205172de /src/mesa/main/uniform_query.cpp | |
parent | 411abcb23751ff57de9843e992647a8e41daab75 (diff) |
mesa: Use MAX2 to calculate maximum uniform element
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 7b089fa9595..2dc9f273b47 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); |