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 {
|
fn get_vulkan_info(pci_id: &str) -> VulkanInfo {
|
||||||
let instance = Instance::new(None, &InstanceExtensions::none(), None)
|
let mut device_name = String::from("Not supported");
|
||||||
.expect("failed to create instance");
|
let mut api_version = String::new();
|
||||||
|
let mut features = String::new();
|
||||||
|
|
||||||
for physical in PhysicalDevice::enumerate(&instance) {
|
match Instance::new(None, &InstanceExtensions::none(), None) {
|
||||||
if format!("{:x}", physical.pci_device_id()) == pci_id.to_lowercase() {
|
Ok(instance) => {
|
||||||
let api_version = physical.api_version().to_string();
|
for physical in PhysicalDevice::enumerate(&instance) {
|
||||||
let device_name = physical.name().to_string();
|
if format!("{:x}", physical.pci_device_id()) == pci_id.to_lowercase() {
|
||||||
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 {
|
}
|
||||||
device_name,
|
}
|
||||||
api_version,
|
},
|
||||||
features,
|
Err(_) => (),
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VulkanInfo {
|
VulkanInfo {
|
||||||
device_name: "Not supported".to_string(),
|
device_name,
|
||||||
api_version: "".to_string(),
|
api_version,
|
||||||
features: "".to_string(),
|
features,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user