glsl: fix potential bug in nir uniform linker
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 10 Jan 2020 01:28:24 +0000 (12:28 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 12 Jan 2020 00:02:20 +0000 (11:02 +1100)
commit6bafd230e37c78829bae680a36e1565df03731f6
tree23d6cd75635dedee8ae17872915713dd75649628
parentdb7967ef9f08e1430bbebc752bcbb63e8c921c29
glsl: fix potential bug in nir uniform linker

The state value of main_uniform_storage_index will be wrong for
add_parameter() when find_and_update_previous_uniform_storage()
finds a uniform if there is more than 1 uniform used in
multiple shader stages.

The new code is also simpler.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/compiler/glsl/gl_nir_link_uniforms.c