From ef47069cc30e0a3337fcb6ff0c740e1bc50879c5 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 10 Feb 2020 09:19:44 +1100 Subject: [PATCH] glsl: reset next_image_index count for each shader stage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: --- src/compiler/glsl/gl_nir_link_uniforms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.30.2