egui: fall back to software rendering
This commit is contained in:
parent
8ff205a266
commit
17e434ba34
1 changed files with 45 additions and 38 deletions
|
|
@ -408,7 +408,8 @@ impl EgvRenderer {
|
|||
.enumerate_physical_devices()
|
||||
.map_err(EgvError::EnumeratePhysicalDevice)?
|
||||
};
|
||||
'outer: for phy in devices {
|
||||
for software in [false, true] {
|
||||
'outer: for &phy in &devices {
|
||||
let res = unsafe { instance.enumerate_device_extension_properties(phy) };
|
||||
let exts = match res {
|
||||
Ok(res) => map_extension_properties(res),
|
||||
|
|
@ -429,7 +430,9 @@ impl EgvRenderer {
|
|||
physical_device = phy;
|
||||
device_extensions = exts;
|
||||
device_properties = props;
|
||||
if let Some(dev) = dev {
|
||||
if let Some(dev) = dev
|
||||
&& !software
|
||||
{
|
||||
if device_extensions.not_contains_key(physical_device_drm::NAME) {
|
||||
continue 'outer;
|
||||
}
|
||||
|
|
@ -450,8 +453,12 @@ impl EgvRenderer {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Err(EgvError::NoVulkanDevice);
|
||||
}
|
||||
if device_properties.device_type == PhysicalDeviceType::CPU && dev.is_some() {
|
||||
log::warn!("Using software rendering");
|
||||
}
|
||||
if device_properties.api_version < VULKAN_API_VERSION {
|
||||
return Err(EgvError::NoVulkan13);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue