summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2016-04-03 11:45:02 +0200
committerBas Nieuwenhuizen <[email protected]>2016-04-05 19:19:18 +0200
commit799789ba99f4bd27119cf46cc0e7f5384ec3d01e (patch)
tree770f46c37d9c1a3a5988a540f6f34a6c2432cf50
parent713353db182dbf5d9be802aa2c1ec7d6debd07a9 (diff)
radeonsi: use bounded indexing for samplers
Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index ca2ff4dfcae..bf3f00867e9 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);