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

Author: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Date:   Sun Apr  3 11:45:02 2016 +0200

radeonsi: use bounded indexing for samplers

Signed-off-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

---

 src/gallium/drivers/radeonsi/si_shader.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index ca2ff4d..bf3f008 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3357,7 +3357,10 @@ static void tex_fetch_ptrs(
                const struct tgsi_full_src_register *reg = 
&emit_data->inst->Src[sampler_src];
                LLVMValueRef ind_index;
 
-               ind_index = get_indirect_index(ctx, &reg->Indirect, 
reg->Register.Index);
+               ind_index = get_bounded_indirect_index(ctx,
+                                                      &reg->Indirect,
+                                                      reg->Register.Index,
+                                                      SI_NUM_USER_SAMPLERS);
 
                *res_ptr = get_sampler_desc(ctx, ind_index, DESC_IMAGE);
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to