glsl: set the correct number of samplers in a shader
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 20 Feb 2020 22:34:26 +0000 (09:34 +1100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 23:48:46 +0000 (23:48 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3992>

src/compiler/glsl/gl_nir_link_uniforms.c

index 1a09843454cbeb5aa55d43b8ed25861f6498872d..fea54083335280631f0d3a95b5b75010cf3bd77e 100644 (file)
@@ -607,7 +607,10 @@ nir_link_uniform(struct gl_context *ctx,
          int sampler_index =
             get_next_index(state, uniform, &state->next_sampler_index);
 
-         state->num_shader_samplers++;
+         /* Samplers (bound or bindless) are counted as two components as
+          * specified by ARB_bindless_texture.
+          */
+         state->num_shader_samplers += values / 2;
 
          uniform->opaque[stage].active = true;
          uniform->opaque[stage].index = sampler_index;