From: Timothy Arceri Date: Sun, 9 Feb 2020 22:19:44 +0000 (+1100) Subject: glsl: reset next_image_index count for each shader stage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef47069cc30e0a3337fcb6ff0c740e1bc50879c5;p=mesa.git glsl: reset next_image_index count for each shader stage This fixes the image index calculation in the nir linker. We need to reset the counter to 0 for each shader stage not each program. Reviewed-by: Alejandro PiƱeiro Part-of: --- diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 7249829c564..8c55b9a2dc1 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -245,9 +245,9 @@ struct nir_link_uniforms_state { unsigned num_values; unsigned max_uniform_location; unsigned next_sampler_index; - unsigned next_image_index; /* per-shader stage */ + unsigned next_image_index; unsigned num_shader_samplers; unsigned num_shader_images; unsigned num_shader_uniform_components; @@ -706,6 +706,7 @@ gl_nir_link_uniforms(struct gl_context *ctx, nir_shader *nir = sh->Program->nir; assert(nir); + state.next_image_index = 0; state.num_shader_samplers = 0; state.num_shader_images = 0; state.num_shader_uniform_components = 0;