zink: fix load/store scratch offsets
authorKarol Herbst <kherbst@redhat.com>
Fri, 29 Sep 2023 08:53:53 +0000 (10:53 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 14 Oct 2023 01:01:16 +0000 (01:01 +0000)
The offset is originally in bytes, so we have to handle it just like
shared load/stores.

Fixes: ddc5c304899 ("zink: handle global and scratch vars")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>

src/gallium/drivers/zink/zink_compiler.c

index d2061e492a9f9793dfdd15222f9c1375df2318ff..7dd83c63d051b281f5e442f8c327d9fb142a789a 100644 (file)
@@ -2044,6 +2044,7 @@ rewrite_bo_access_instr(nir_builder *b, nir_instr *instr, void *data)
       }
       return true;
    }
+   case nir_intrinsic_load_scratch:
    case nir_intrinsic_load_shared:
       b->cursor = nir_before_instr(instr);
       bool force_2x32 = intr->def.bit_size == 64 && !has_int64;
@@ -2080,6 +2081,7 @@ rewrite_bo_access_instr(nir_builder *b, nir_instr *instr, void *data)
       }
       return true;
    }
+   case nir_intrinsic_store_scratch:
    case nir_intrinsic_store_shared: {
       b->cursor = nir_before_instr(instr);
       bool force_2x32 = nir_src_bit_size(intr->src[0]) == 64 && !has_int64;