mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
Handle when vulkan is unsupported
This commit is contained in:
parent
3ceebe0b3e
commit
55bc2ee468
@ -262,27 +262,30 @@ impl GpuController {
|
||||
}
|
||||
|
||||
fn get_vulkan_info(pci_id: &str) -> VulkanInfo {
|
||||
let instance = Instance::new(None, &InstanceExtensions::none(), None)
|
||||
.expect("failed to create instance");
|
||||
let mut device_name = String::from("Not supported");
|
||||
let mut api_version = String::new();
|
||||
let mut features = String::new();
|
||||
|
||||
match Instance::new(None, &InstanceExtensions::none(), None) {
|
||||
Ok(instance) => {
|
||||
for physical in PhysicalDevice::enumerate(&instance) {
|
||||
if format!("{:x}", physical.pci_device_id()) == pci_id.to_lowercase() {
|
||||
let api_version = physical.api_version().to_string();
|
||||
let device_name = physical.name().to_string();
|
||||
let features = format!("{:?}", physical.supported_features());
|
||||
api_version = physical.api_version().to_string();
|
||||
device_name = physical.name().to_string();
|
||||
features = format!("{:?}", physical.supported_features());
|
||||
|
||||
return VulkanInfo {
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(_) => (),
|
||||
}
|
||||
|
||||
|
||||
VulkanInfo {
|
||||
device_name,
|
||||
api_version,
|
||||
features,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
VulkanInfo {
|
||||
device_name: "Not supported".to_string(),
|
||||
api_version: "".to_string(),
|
||||
features: "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user