From 5d013da038f2b9a67bf76f64e48787b240ad3c56 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 7 Jun 2024 16:36:41 +0200 Subject: [PATCH] rusticl/memory: copies might overlap for host ptrs We can't really gurantee there is no overlap, because applications might pass in arbitrary host pointers. Cc: mesa-stable Part-of: --- src/gallium/frontends/rusticl/core/memory.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/memory.rs b/src/gallium/frontends/rusticl/core/memory.rs index 753c9c478a1..94f27318997 100644 --- a/src/gallium/frontends/rusticl/core/memory.rs +++ b/src/gallium/frontends/rusticl/core/memory.rs @@ -369,7 +369,7 @@ fn sw_copy( for z in 0..region[2] { for y in 0..region[1] { unsafe { - ptr::copy_nonoverlapping( + ptr::copy( src.add( (*src_origin + [0, y, z]) * [pixel_size as usize, src_row_pitch, src_slice_pitch], @@ -928,7 +928,7 @@ impl Buffer { let tx = self.tx(q, ctx, offset, size, RWFlags::RD)?; unsafe { - ptr::copy_nonoverlapping(tx.ptr(), ptr, size); + ptr::copy(tx.ptr(), ptr, size); } Ok(())