From 7e65cff93190105422cb2472dcf74904d76dd6f7 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Mon, 15 May 2023 15:50:19 +0200 Subject: rusticl/device: use PLATFORM_EXTENSIONS as a template for filling extensions Signed-off-by: Karol Herbst Reviewed-by: Nora Allen Part-of: --- src/gallium/frontends/rusticl/api/platform.rs | 2 +- src/gallium/frontends/rusticl/core/device.rs | 5 ++--- src/gallium/frontends/rusticl/core/platform.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/frontends/rusticl/api/platform.rs b/src/gallium/frontends/rusticl/api/platform.rs index dcefdf6cf56..a778bbe0a49 100644 --- a/src/gallium/frontends/rusticl/api/platform.rs +++ b/src/gallium/frontends/rusticl/api/platform.rs @@ -11,7 +11,7 @@ impl CLInfo for cl_platform_id { self.get_ref()?; Ok(match q { // TODO spirv - CL_PLATFORM_EXTENSIONS => cl_prop("cl_khr_icd cl_khr_il_program"), + CL_PLATFORM_EXTENSIONS => cl_prop(PLATFORM_EXTENSION_STR), CL_PLATFORM_EXTENSIONS_WITH_VERSION => { cl_prop::>(PLATFORM_EXTENSIONS.to_vec()) } diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index b8653986945..0bff8a19a83 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -472,7 +472,7 @@ impl Device { fn fill_extensions(&mut self) { let mut exts_str: Vec = Vec::new(); - let mut exts = Vec::new(); + let mut exts = PLATFORM_EXTENSIONS.to_vec(); let mut feats = Vec::new(); let mut add_ext = |major, minor, patch, ext: &str, feat: &str| { if !ext.is_empty() { @@ -489,7 +489,6 @@ impl Device { add_ext(1, 0, 0, "cl_khr_byte_addressable_store", ""); add_ext(1, 0, 0, "cl_khr_global_int32_base_atomics", ""); add_ext(1, 0, 0, "cl_khr_global_int32_extended_atomics", ""); - add_ext(1, 0, 0, "cl_khr_il_program", ""); add_ext(1, 0, 0, "cl_khr_local_int32_base_atomics", ""); add_ext(1, 0, 0, "cl_khr_local_int32_extended_atomics", ""); @@ -535,7 +534,7 @@ impl Device { self.extensions = exts; self.clc_features = feats; - self.extension_string = exts_str.join(" "); + self.extension_string = format!("{} {}", PLATFORM_EXTENSION_STR, exts_str.join(" ")); } fn shader_param(&self, cap: pipe_shader_cap) -> i32 { diff --git a/src/gallium/frontends/rusticl/core/platform.rs b/src/gallium/frontends/rusticl/core/platform.rs index f501d12dc8c..152197e9334 100644 --- a/src/gallium/frontends/rusticl/core/platform.rs +++ b/src/gallium/frontends/rusticl/core/platform.rs @@ -30,6 +30,7 @@ pub static PLATFORM_EXTENSIONS: [cl_name_version; 2] = [ mk_cl_version_ext(1, 0, 0, "cl_khr_icd"), mk_cl_version_ext(1, 0, 0, "cl_khr_il_program"), ]; +pub static PLATFORM_EXTENSION_STR: &str = "cl_khr_icd cl_khr_il_program"; static mut PLATFORM: Platform = Platform { dispatch: &DISPATCH, -- cgit v1.2.1