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>
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user