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: 06daa03c5c ("rusticl: Implement spec for cl_khr_image2d_from_buffer")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24993>
(cherry picked from commit 5263802618)
This commit is contained in:
Karol Herbst 2023-09-01 12:49:59 +02:00 committed by Dylan Baker
parent 355e68efe1
commit fa0689d2ba
2 changed files with 2 additions and 2 deletions

View file

@ -8854,7 +8854,7 @@
"description": "rusticl/memory: do not verify pitch for IMAGE1D_BUFFER",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "06daa03c5cd2d8aea6ee797923d2bbfdf500caef",
"notes": null

View file

@ -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())