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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29604>
This commit is contained in:
Karol Herbst
2024-06-07 16:36:41 +02:00
committed by Marge Bot
parent e522c91d5c
commit 5d013da038
+2 -2
View File
@@ -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(())