rusticl/device: Make supported 1Dbuffer formats a strict subset of 1D

This works around a bug in the OpenCL CTS, which a few drivers here run
into.

Fixes a couple of tests with agx.

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30514>
This commit is contained in:
Karol Herbst
2024-08-04 23:41:29 +02:00
committed by Marge Bot
parent f8553f56ac
commit 50ce777edd

View File

@@ -293,6 +293,14 @@ impl Device {
fs.insert(t, flags as cl_mem_flags);
}
// Restrict supported formats with 1DBuffer images. This is an OpenCL CTS workaround.
// See https://github.com/KhronosGroup/OpenCL-CTS/issues/1889
let image1d_mask = fs[&CL_MEM_OBJECT_IMAGE1D];
if let Some(entry) = fs.get_mut(&CL_MEM_OBJECT_IMAGE1D_BUFFER) {
*entry &= image1d_mask;
}
self.formats.insert(f.cl_image_format, fs);
}