Module: Mesa
Branch: main
Commit: e79d9a9cc84bb444511c89a147f23044842cbf4b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e79d9a9cc84bb444511c89a147f23044842cbf4b

Author: Karol Herbst <[email protected]>
Date:   Sun Oct 15 16:00:30 2023 +0200

rusticl/device: restrict 1Dbuffer images for RGB and RGBx

Fixes: 20c90fed5a0 ("rusticl: added")
Signed-off-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25739>

---

 src/gallium/frontends/rusticl/core/device.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/frontends/rusticl/core/device.rs 
b/src/gallium/frontends/rusticl/core/device.rs
index 36d3af8418c..2565598edac 100644
--- a/src/gallium/frontends/rusticl/core/device.rs
+++ b/src/gallium/frontends/rusticl/core/device.rs
@@ -252,6 +252,16 @@ impl Device {
         for f in FORMATS {
             let mut fs = HashMap::new();
             for t in CL_IMAGE_TYPES {
+                // the CTS doesn't test them, so let's not advertize them by 
accident if they are
+                // broken
+                if t == CL_MEM_OBJECT_IMAGE1D_BUFFER
+                    && [CL_RGB, 
CL_RGBx].contains(&f.cl_image_format.image_channel_order)
+                    && ![CL_UNORM_SHORT_565, CL_UNORM_SHORT_555]
+                        .contains(&f.cl_image_format.image_channel_data_type)
+                {
+                    continue;
+                }
+
                 let mut flags: cl_uint = 0;
                 if self.screen.is_format_supported(
                     f.pipe,

Reply via email to