summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2016-04-03 11:39:52 +0200
committerBas Nieuwenhuizen <[email protected]>2016-04-05 19:19:07 +0200
commit713353db182dbf5d9be802aa2c1ec7d6debd07a9 (patch)
tree1e92f25265e65104eafc48a4df0a5af8a291e985
parenta64dbdf612805daff0bbc70bba26053bd226ae70 (diff)
radeonsi: use bounded indexing for constant buffers
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, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 56c575948ab..ca2ff4dfcae 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1328,8 +1328,9 @@ static LLVMValueRef fetch_constant(
if (reg->Register.Dimension && reg->Dimension.Indirect) {
LLVMValueRef ptr = LLVMGetParam(ctx->radeon_bld.main_fn, SI_PARAM_CONST_BUFFERS);
LLVMValueRef index;
- index = get_indirect_index(ctx, &reg->DimIndirect,
- reg->Dimension.Index);
+ index = get_bounded_indirect_index(ctx, &reg->DimIndirect,
+ reg->Dimension.Index,
+ SI_NUM_USER_CONST_BUFFERS);
bufp = build_indexed_load_const(ctx, ptr, index);
} else
bufp = ctx->const_buffers[buf];