From 01bac643f6c088f7537edf18f2d4094881c1ecda Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 15 May 2024 13:24:25 -0700 Subject: [PATCH] freedreno/ir3: Fix ldg/stg offset Basically a revert (but not a clean one) of commit 60686d4146cd ("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 513fa1873cf5 ("ir3/a7xx: Fix load_global_ir3 with immediate offset") you could instead just revert the original commit. Fixes: 60686d4146cd ir3/a6xx: ("fix ldg/stg of ulong2 and ulong4 data") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11169 Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_a6xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_a6xx.c b/src/freedreno/ir3/ir3_a6xx.c index dec3949de73..596ec62abdf 100644 --- a/src/freedreno/ir3/ir3_a6xx.c +++ b/src/freedreno/ir3/ir3_a6xx.c @@ -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 {