mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 12:30:11 +01:00
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>
This commit is contained in:
parent
411abcb237
commit
8f81f4e185
1 changed files with 1 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue