summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-05-17 21:11:13 +0200
committerMarek Olšák <[email protected]>2017-05-18 22:15:02 +0200
commitb8f8d9e46c6ac625928c9b098491fa26e4cf8f71 (patch)
treee737dd133f4cea60b253e16df0a07e61b10f03bc /src/gallium/drivers/radeonsi/si_shader.c
parentf07c15ef807fb50659bf7a648393991f582f6a7f (diff)
radeonsi: clamp indirect index to the number of declared shader resources
We'll do partial uploads of descriptor arrays, so we need to clamp against what shaders declare. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index f847e46e5dc..61f1384ad7a 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1763,7 +1763,7 @@ static LLVMValueRef fetch_constant(
LLVMValueRef index;
index = si_get_bounded_indirect_index(ctx, &reg->DimIndirect,
reg->Dimension.Index,
- SI_NUM_CONST_BUFFERS);
+ ctx->num_const_buffers);
index = LLVMBuildAdd(ctx->gallivm.builder, index,
LLVMConstInt(ctx->i32, SI_NUM_SHADER_BUFFERS, 0), "");
bufp = ac_build_indexed_load_const(&ctx->ac, ptr, index);