Mesa (master): glsl: set the correct number of images in a shader

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 29 00:30:28 UTC 2020


Module: Mesa
Branch: master
Commit: 190a1ed170231d6f1db0526a1867a6766ccd4823
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=190a1ed170231d6f1db0526a1867a6766ccd4823

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Fri Feb 28 09:53:51 2020 +1100

glsl: set the correct number of images in a shader

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3992>

---

 src/compiler/glsl/gl_nir_link_uniforms.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c
index fea54083335..7196d8b2c1f 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++ b/src/compiler/glsl/gl_nir_link_uniforms.c
@@ -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;



More information about the mesa-commit mailing list