freedreno/ir3: Fix ldg/stg offset

Basically a revert (but not a clean one) of commit 60686d4146
("ir3/a6xx: fix ldg/stg of ulong2 and ulong4 data").  The offset
is a byte offset, not a dword offset.

Backport note: Prior to commit 513fa1873c ("ir3/a7xx: Fix
load_global_ir3 with immediate offset") you could instead just revert
the original commit.

Fixes: 60686d4146 ir3/a6xx: ("fix ldg/stg of ulong2 and ulong4 data")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11169
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29228>
This commit is contained in:
Rob Clark 2024-05-15 13:24:25 -07:00 committed by Marge Bot
parent 23488790c1
commit 01bac643f6

View file

@ -346,7 +346,7 @@ emit_intrinsic_load_global_ir3(struct ir3_context *ctx,
if (const_offset_in_bounds) {
load = ir3_LDG(b, addr, 0,
create_immed(b, nir_src_as_int(intr->src[1]) << shift),
create_immed(b, (nir_src_as_int(intr->src[1]) * 4) << shift),
0, create_immed(b, dest_components), 0);
} else {
offset = ir3_get_src(ctx, &intr->src[1])[0];
@ -389,7 +389,7 @@ emit_intrinsic_store_global_ir3(struct ir3_context *ctx,
if (const_offset_in_bounds) {
stg = ir3_STG(b, addr, 0,
create_immed(b, nir_src_as_int(intr->src[2])), 0,
create_immed(b, nir_src_as_int(intr->src[2]) * 4), 0,
value, 0,
create_immed(b, ncomp), 0);
} else {