Don't use the UNMAPPED_UNIFORM_LOC (-1) to set the unsigned
max_uniform_location. Those unmapped uniforms don't have to be
accounted at this point.
Fixes: 7a9e5cdfbb9 ("nir/linker: Add gl_nir_link_uniforms()")
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
state->num_shader_uniform_components += values;
state->num_values += values;
- if (state->max_uniform_location < uniform->remap_location + entries)
+ if (uniform->remap_location != UNMAPPED_UNIFORM_LOC &&
+ state->max_uniform_location < uniform->remap_location + entries)
state->max_uniform_location = uniform->remap_location + entries;
return MAX2(uniform->array_elements, 1);