rusticl: allow devices to be enabled by default
Reviewed-by: David Heidelberg <david@ixit.cz> Acked-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31202>
This commit is contained in:
@@ -160,6 +160,14 @@ option(
|
||||
description : 'build gallium "rusticl" OpenCL frontend.',
|
||||
)
|
||||
|
||||
option(
|
||||
'gallium-rusticl-enable-drivers',
|
||||
type : 'array',
|
||||
value : ['auto'],
|
||||
description : 'List of gallium drivers for which rusticl will be enabled ' +
|
||||
'by default',
|
||||
)
|
||||
|
||||
option(
|
||||
'gallium-wgl-dll-name',
|
||||
type : 'string',
|
||||
|
@@ -55,7 +55,11 @@ fn load_devs() -> impl Iterator<Item = PipeLoaderDevice> {
|
||||
fn get_enabled_devs() -> HashMap<String, u32> {
|
||||
let mut res = HashMap::new();
|
||||
|
||||
if let Ok(enabled_devs) = env::var("RUSTICL_ENABLE") {
|
||||
// we require the type here as this list can be empty depending on the build options
|
||||
let default_devs: &[&str] = &[];
|
||||
|
||||
// I wished we could use different iterators, but that's not really working out.
|
||||
let enabled_devs = env::var("RUSTICL_ENABLE").unwrap_or(default_devs.join(","));
|
||||
let mut last_driver = None;
|
||||
for driver_str in enabled_devs.split(',') {
|
||||
if driver_str.is_empty() {
|
||||
@@ -92,7 +96,6 @@ fn get_enabled_devs() -> HashMap<String, u32> {
|
||||
if res.contains_key("panfrost") {
|
||||
res.insert("panthor".to_owned(), res["panfrost"]);
|
||||
}
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
@@ -75,6 +75,13 @@ rusticl_args = [
|
||||
'-Aclippy::type_complexity',
|
||||
]
|
||||
|
||||
rusticl_drivers_enable = get_option('gallium-rusticl-enable-drivers')
|
||||
foreach driver : rusticl_drivers_enable
|
||||
rusticl_args += [
|
||||
'--cfg', 'rusticl_enable_' + driver,
|
||||
]
|
||||
endforeach
|
||||
|
||||
if with_platform_x11
|
||||
rusticl_args += [
|
||||
'--cfg', 'glx',
|
||||
|
Reference in New Issue
Block a user