glsl: set the correct number of images in a shader
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 27 Feb 2020 22:53:51 +0000 (09:53 +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 fea54083335280631f0d3a95b5b75010cf3bd77e..7196d8b2c1fca2ddc7bfb95afc66fd15906c9fd1 100644 (file)
@@ -636,7 +636,10 @@ nir_link_uniform(struct gl_context *ctx,
          int image_index = state->next_image_index;
          state->next_image_index += entries;
 
-         state->num_shader_images++;
+         /* Images (bound or bindless) are counted as two components as
+          * specified by ARB_bindless_texture.
+          */
+         state->num_shader_images += values / 2;
 
          uniform->opaque[stage].active = true;
          uniform->opaque[stage].index = image_index;