render_vulkan: Avoid continue loop if all queues is found
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m36s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m36s
This commit is contained in:
parent
18174e42e9
commit
9ea8721346
1 changed files with 18 additions and 12 deletions
|
@ -87,7 +87,7 @@ fn pick_physical_device(world: &World, config: &VulkanConfig) -> Option<PickedDe
|
||||||
.get_resource::<VulkanInstance>()
|
.get_resource::<VulkanInstance>()
|
||||||
.expect("Failed to get VulkanInstance during vulkan plugin initialization");
|
.expect("Failed to get VulkanInstance during vulkan plugin initialization");
|
||||||
|
|
||||||
let result = instance
|
instance
|
||||||
.0
|
.0
|
||||||
.enumerate_physical_devices()
|
.enumerate_physical_devices()
|
||||||
.expect("Failed to enumerate physical devices")
|
.expect("Failed to enumerate physical devices")
|
||||||
|
@ -100,17 +100,15 @@ fn pick_physical_device(world: &World, config: &VulkanConfig) -> Option<PickedDe
|
||||||
PhysicalDeviceType::Other => 4,
|
PhysicalDeviceType::Other => 4,
|
||||||
_ => 5,
|
_ => 5,
|
||||||
})
|
})
|
||||||
.take();
|
.take()
|
||||||
|
.and_then(|(p, (device_extensions, picked_queues_info))| {
|
||||||
match result {
|
Some(create_device(
|
||||||
Some((p, (device_extensions, picked_queues_info))) => Some(create_device(
|
config,
|
||||||
config,
|
&p,
|
||||||
&p,
|
device_extensions,
|
||||||
device_extensions,
|
&picked_queues_info,
|
||||||
&picked_queues_info,
|
))
|
||||||
)),
|
})
|
||||||
None => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_device_extensions_support(
|
fn check_device_extensions_support(
|
||||||
|
@ -197,6 +195,14 @@ fn check_queues_support(
|
||||||
transfer_queue_family_index = Some(i as u32);
|
transfer_queue_family_index = Some(i as u32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config.with_graphics_queue || graphics_queue_family_index.is_some())
|
||||||
|
&& (!config.with_compute_queue || compute_queue_family_index.is_some())
|
||||||
|
&& (!config.with_transfer_queue || transfer_queue_family_index.is_some())
|
||||||
|
{
|
||||||
|
// We found all required queues, no need to continue iterating
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !config.with_graphics_queue {
|
if !config.with_graphics_queue {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue