aco: fix max_const_offset_plus_one overflow

smem_offset_max is UINT32_MAX on GFX7 and setting
max_const_offset_plus_one to 0 causes divisions by zero later.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: c26851b80b ("aco: increase max_const_offset_plus_one for SMEM load_global")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34766>
This commit is contained in:
Rhys Perry 2025-04-30 16:11:52 +01:00 committed by Marge Bot
parent 615d0c9669
commit a85ebe16b3

View file

@ -4230,7 +4230,7 @@ struct EmitLoadParameters {
Temp dst_hint);
Callback callback;
unsigned max_const_offset_plus_one;
uint64_t max_const_offset_plus_one;
};
void
@ -6675,7 +6675,7 @@ visit_load_global(isel_context* ctx, nir_intrinsic_instr* instr)
info.offset = Operand(bld.as_uniform(info.offset));
info.cache = get_cache_flags(ctx, access | ACCESS_TYPE_SMEM);
EmitLoadParameters params = smem_load_params;
params.max_const_offset_plus_one = ctx->program->dev.smem_offset_max + 1;
params.max_const_offset_plus_one = ctx->program->dev.smem_offset_max + UINT64_C(1);
emit_load(ctx, bld, info, params);
} else {
EmitLoadParameters params = global_load_params;