mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
radeonsi: handle an out-of-bounds sampler/image index better
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15965>
This commit is contained in:
parent
7341cb7654
commit
80bc6f9e28
1 changed files with 4 additions and 1 deletions
|
|
@ -280,7 +280,10 @@ static LLVMValueRef si_nir_load_sampler_desc(struct ac_shader_abi *abi, unsigned
|
|||
}
|
||||
|
||||
unsigned num_slots = image ? ctx->num_images : ctx->num_samplers;
|
||||
assert(const_index < num_slots || dynamic_index);
|
||||
|
||||
/* Redirect invalid resource indices to the first array element. */
|
||||
if (const_index >= num_slots)
|
||||
const_index = base_index;
|
||||
|
||||
LLVMValueRef list = ac_get_arg(&ctx->ac, ctx->samplers_and_images);
|
||||
LLVMValueRef index = LLVMConstInt(ctx->ac.i32, const_index, false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue