mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
aco: fix global_atomic_swap offset overflow check
Fixes: d7dcd81c77 ("aco/gfx6: allow both constant and gpr offset for global with sgpr address")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37821>
This commit is contained in:
parent
451a0bd490
commit
c13caa5e5f
1 changed files with 6 additions and 2 deletions
|
|
@ -2542,10 +2542,13 @@ visit_global_atomic(isel_context* ctx, nir_intrinsic_instr* instr)
|
|||
|
||||
const nir_atomic_op nir_op = nir_intrinsic_atomic_op(instr);
|
||||
const bool cmpswap = nir_op == nir_atomic_op_cmpxchg;
|
||||
unsigned offset_idx = 2;
|
||||
|
||||
if (cmpswap)
|
||||
if (cmpswap) {
|
||||
offset_idx = 3;
|
||||
data = bld.pseudo(aco_opcode::p_create_vector, bld.def(RegType::vgpr, data.size() * 2),
|
||||
get_ssa_temp(ctx, instr->src[2].ssa), data);
|
||||
}
|
||||
|
||||
Temp dst = get_ssa_temp(ctx, &instr->def);
|
||||
|
||||
|
|
@ -2554,7 +2557,8 @@ visit_global_atomic(isel_context* ctx, nir_intrinsic_instr* instr)
|
|||
Temp addr, offset;
|
||||
uint32_t const_offset;
|
||||
parse_global(ctx, instr, &addr, &const_offset, &offset);
|
||||
Format format = lower_global_address(ctx, bld, 0, &addr, &const_offset, &offset, &instr->src[2]);
|
||||
Format format =
|
||||
lower_global_address(ctx, bld, 0, &addr, &const_offset, &offset, &instr->src[offset_idx]);
|
||||
|
||||
if (format != Format::MUBUF) {
|
||||
bool global = format == Format::GLOBAL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue