diff options
author | Karol Herbst <git@karolherbst.de> | 2023-05-15 15:49:46 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-05-16 21:07:08 +0000 |
commit | c3af8f3c111f21f03b4d1a8fd188b80d9ccf57b3 (patch) | |
tree | 8adec8c2e7dabb6f3eb8776f0b9347e23296a29c | |
parent | 975a2c17a4e8cfd235dddd4c06e0dc49ab7504b3 (diff) | |
download | mesa-c3af8f3c111f21f03b4d1a8fd188b80d9ccf57b3.tar.gz |
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>rusticl/platform: make the extension array a static
This way we can use it inside `Device::fill_extensions`
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>
-rw-r--r-- | src/gallium/frontends/rusticl/api/platform.rs | 4 | ||||
-rw-r--r-- | src/gallium/frontends/rusticl/core/platform.rs | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/frontends/rusticl/api/platform.rs b/src/gallium/frontends/rusticl/api/platform.rs index 7641ff33279..dcefdf6cf56 100644 --- a/src/gallium/frontends/rusticl/api/platform.rs +++ b/src/gallium/frontends/rusticl/api/platform.rs @@ -8,12 +8,12 @@ use rusticl_opencl_gen::*; impl CLInfo<cl_platform_info> for cl_platform_id { fn query(&self, q: cl_platform_info, _: &[u8]) -> CLResult<Vec<u8>> { - let p = self.get_ref()?; + self.get_ref()?; Ok(match q { // TODO spirv CL_PLATFORM_EXTENSIONS => cl_prop("cl_khr_icd cl_khr_il_program"), CL_PLATFORM_EXTENSIONS_WITH_VERSION => { - cl_prop::<Vec<cl_name_version>>(p.extensions.to_vec()) + cl_prop::<Vec<cl_name_version>>(PLATFORM_EXTENSIONS.to_vec()) } CL_PLATFORM_HOST_TIMER_RESOLUTION => cl_prop::<cl_ulong>(0), CL_PLATFORM_ICD_SUFFIX_KHR => cl_prop("MESA"), diff --git a/src/gallium/frontends/rusticl/core/platform.rs b/src/gallium/frontends/rusticl/core/platform.rs index 2126dfa510a..f501d12dc8c 100644 --- a/src/gallium/frontends/rusticl/core/platform.rs +++ b/src/gallium/frontends/rusticl/core/platform.rs @@ -13,7 +13,6 @@ use std::sync::Once; #[repr(C)] pub struct Platform { dispatch: &'static cl_icd_dispatch, - pub extensions: [cl_name_version; 2], pub devs: Vec<Arc<Device>>, } @@ -27,13 +26,13 @@ pub struct PlatformFeatures { static PLATFORM_ENV_ONCE: Once = Once::new(); static PLATFORM_ONCE: Once = Once::new(); +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"), +]; static mut PLATFORM: Platform = Platform { dispatch: &DISPATCH, - extensions: [ - mk_cl_version_ext(1, 0, 0, "cl_khr_icd"), - mk_cl_version_ext(1, 0, 0, "cl_khr_il_program"), - ], devs: Vec::new(), }; static mut PLATFORM_DBG: PlatformDebug = PlatformDebug { program: false }; |