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

Author: Timothy Arceri <[email protected]>
Date:   Fri Feb 21 09:34:26 2020 +1100

glsl: set the correct number of samplers in a shader

Reviewed-by: Alejandro PiƱeiro <[email protected]>
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 1a09843454c..fea54083335 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++ b/src/compiler/glsl/gl_nir_link_uniforms.c
@@ -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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to