From e867ae6bccc826d44be4f527a90b606033e688ae Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 19 Apr 2022 23:49:34 +0200 Subject: [PATCH] rusticl: fix compiler features_macro Signed-off-by: Karol Herbst Acked-by: Alyssa Rosenzweig Part-of: --- src/gallium/frontends/rusticl/core/device.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index 1048823616a..bed1c9daea3 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -416,13 +416,7 @@ impl Device { if self.image_supported() { add_ext(1, 0, 0, "", "__opencl_c_images"); - if !FORMATS - .iter() - .filter(|f| f.req_for_3d_image_write_ext) - .map(|f| self.formats.get(&f.cl_image_format).unwrap()) - .map(|f| f.get(&CL_MEM_OBJECT_IMAGE3D).unwrap()) - .any(|f| *f & cl_mem_flags::from(CL_MEM_WRITE_ONLY) == 0) - { + if self.image_3d_write_supported() { add_ext( 1, 0, @@ -536,6 +530,15 @@ impl Device { self.image_2d_size() >= 2048 } + pub fn image_3d_write_supported(&self) -> bool { + !FORMATS + .iter() + .filter(|f| f.req_for_3d_image_write_ext) + .map(|f| self.formats.get(&f.cl_image_format).unwrap()) + .map(|f| f.get(&CL_MEM_OBJECT_IMAGE3D).unwrap()) + .any(|f| *f & cl_mem_flags::from(CL_MEM_WRITE_ONLY) == 0) + } + pub fn image_write_count(&self) -> cl_uint { self.shader_param(pipe_shader_cap::PIPE_SHADER_CAP_MAX_SHADER_IMAGES) as cl_uint } @@ -637,7 +640,7 @@ impl Device { int64: self.long_supported(), images: self.image_supported(), images_read_write: false, - images_write_3d: false, + images_write_3d: self.image_3d_write_supported(), intel_subgroups: false, subgroups: false, }