From 526380261821cf820d70963ba07f61f46436ba9e Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 1 Sep 2023 12:49:59 +0200 Subject: [PATCH] rusticl/memory: do not verify pitch for IMAGE1D_BUFFER Devices might report an image_pitch_alignment of 0 leading to a division by 0 trap. Fixes: 06daa03c5cd ("rusticl: Implement spec for cl_khr_image2d_from_buffer") Signed-off-by: Karol Herbst Part-of: --- src/gallium/frontends/rusticl/api/memory.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/rusticl/api/memory.rs b/src/gallium/frontends/rusticl/api/memory.rs index 0f867c4..0de2a39 100644 --- a/src/gallium/frontends/rusticl/api/memory.rs +++ b/src/gallium/frontends/rusticl/api/memory.rs @@ -511,7 +511,7 @@ fn validate_image_desc( desc.image_slice_pitch = desc.image_row_pitch * desc.image_height; } - if has_buf_parent { + if has_buf_parent && desc.image_type != CL_MEM_OBJECT_IMAGE1D_BUFFER { let pitch_alignment = devs .iter() .map(|d| d.image_pitch_alignment()) -- 2.7.4