Module: Mesa
Branch: main
Commit: daa8a81d99f80b75e51421bfebd98a2e1e7ac6fd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=daa8a81d99f80b75e51421bfebd98a2e1e7ac6fd

Author: Lionel Landwerlin <[email protected]>
Date:   Tue Sep 28 12:17:07 2021 +0300

nir: fix opt_memcpy src/dst mixup

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: f6667cb0ce828a ("nir: Add a memcpy optimization pass")
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13079>

---

 src/compiler/nir/nir_opt_memcpy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opt_memcpy.c 
b/src/compiler/nir/nir_opt_memcpy.c
index fe2a3039be1..be3f19de1ff 100644
--- a/src/compiler/nir/nir_opt_memcpy.c
+++ b/src/compiler/nir/nir_opt_memcpy.c
@@ -152,7 +152,7 @@ try_lower_memcpy(nir_builder *b, nir_intrinsic_instr *cpy)
          nir_load_deref_with_access(b, src, nir_intrinsic_src_access(cpy));
       data = nir_bitcast_vector(b, data, glsl_get_bit_size(dst->type));
       assert(data->num_components == glsl_get_vector_elements(dst->type));
-      nir_store_deref_with_access(b, src, data, ~0 /* write mask */,
+      nir_store_deref_with_access(b, dst, data, ~0 /* write mask */,
                                   nir_intrinsic_dst_access(cpy));
       return true;
    }

Reply via email to