summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <git@karolherbst.de>2023-05-15 15:50:19 +0200
committerMarge Bot <emma+marge@anholt.net>2023-05-16 21:07:08 +0000
commit7e65cff93190105422cb2472dcf74904d76dd6f7 (patch)
tree81d2a789d0d66678c0602e257b8f149ea5c81644
parentc3af8f3c111f21f03b4d1a8fd188b80d9ccf57b3 (diff)
downloadmesa-7e65cff93190105422cb2472dcf74904d76dd6f7.tar.gz
rusticl/device: use PLATFORM_EXTENSIONS as a template for filling 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.rs2
-rw-r--r--src/gallium/frontends/rusticl/core/device.rs5
-rw-r--r--src/gallium/frontends/rusticl/core/platform.rs1
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<cl_platform_info> 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::<Vec<cl_name_version>>(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<String> = 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,