mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
rusticl/mem: fix Image::read for 1Darray images
Some drivers do not return identical strides when mapping 1Darray images leading to data being written in the wrong place. Cc: mesa-stable Tested-by: Rob Clark <rob.clark@oss.qualcomm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37284>
This commit is contained in:
parent
ec87f1338f
commit
b584b47d01
1 changed files with 5 additions and 1 deletions
|
|
@ -1963,7 +1963,7 @@ impl Image {
|
|||
let pixel_size = self.image_format.pixel_size().unwrap();
|
||||
|
||||
let tx;
|
||||
let src_row_pitch;
|
||||
let mut src_row_pitch;
|
||||
let src_slice_pitch;
|
||||
if let Some(Mem::Buffer(buffer)) = self.parent() {
|
||||
src_row_pitch = self.image_desc.image_row_pitch;
|
||||
|
|
@ -1981,6 +1981,10 @@ impl Image {
|
|||
tx = self.tx_image(ctx, &bx, RWFlags::RD)?;
|
||||
src_row_pitch = tx.row_pitch() as usize;
|
||||
src_slice_pitch = tx.slice_pitch();
|
||||
|
||||
if self.mem_type == CL_MEM_OBJECT_IMAGE1D_ARRAY {
|
||||
src_row_pitch = src_slice_pitch;
|
||||
}
|
||||
};
|
||||
|
||||
perf_warning!("clEnqueueReadImage and clEnqueueMapImage stall the GPU");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue