From: Bas Nieuwenhuizen Date: Sun, 3 Apr 2016 09:39:52 +0000 (+0200) Subject: radeonsi: use bounded indexing for constant buffers X-Git-Tag: upstream/17.1.0~11349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=713353db182dbf5d9be802aa2c1ec7d6debd07a9;p=platform%2Fupstream%2Fmesa.git radeonsi: use bounded indexing for constant buffers Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 56c5759..ca2ff4d 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, ®->DimIndirect, - reg->Dimension.Index); + index = get_bounded_indirect_index(ctx, ®->DimIndirect, + reg->Dimension.Index, + SI_NUM_USER_CONST_BUFFERS); bufp = build_indexed_load_const(ctx, ptr, index); } else bufp = ctx->const_buffers[buf];