radeonsi: use bounded indexing for samplers
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 3 Apr 2016 09:45:02 +0000 (11:45 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 5 Apr 2016 17:19:18 +0000 (19:19 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index ca2ff4dfcae29531bbfe057479b12f509c28b9d5..bf3f00867e94fc70e415a89c7b97675349ffec70 100644 (file)
@@ -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);