engine_vulkan: Fix allocate more queue as available and add different priorities
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m56s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 8m56s
This commit is contained in:
parent
d10212ac3b
commit
15565d03c1
1 changed files with 8 additions and 7 deletions
|
@ -50,12 +50,12 @@ pub struct VulkanQueueFamilyIndices {
|
|||
pub transfer_queue_family_index: VulkanQueueFamilyStatus,
|
||||
}
|
||||
|
||||
impl From<VulkanQueueFamilyIndices> for Vec<VulkanQueueFamilyStatus> {
|
||||
impl From<VulkanQueueFamilyIndices> for Vec<(VulkanQueueFamilyStatus, f32)> {
|
||||
fn from(indices: VulkanQueueFamilyIndices) -> Self {
|
||||
vec![
|
||||
indices.graphics_queue_family_index,
|
||||
indices.compute_queue_family_index,
|
||||
indices.transfer_queue_family_index,
|
||||
(indices.graphics_queue_family_index, 1.0),
|
||||
(indices.compute_queue_family_index, 0.5),
|
||||
(indices.transfer_queue_family_index, 0.5),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -64,17 +64,18 @@ impl From<VulkanQueueFamilyIndices> for Vec<QueueCreateInfo> {
|
|||
fn from(indices: VulkanQueueFamilyIndices) -> Self {
|
||||
let mut queue_create_infos = HashMap::<u32, QueueCreateInfo>::new();
|
||||
|
||||
let statuses: Vec<VulkanQueueFamilyStatus> = indices.into();
|
||||
let statuses: Vec<(VulkanQueueFamilyStatus, f32)> = indices.into();
|
||||
|
||||
for status in statuses.iter() {
|
||||
for (status, priority) in statuses.iter() {
|
||||
match status {
|
||||
VulkanQueueFamilyStatus::Supported(index) => {
|
||||
let entry = queue_create_infos.entry(*index).or_insert(QueueCreateInfo {
|
||||
queue_family_index: *index,
|
||||
queues: Vec::new(),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
entry.queues.push(1.0);
|
||||
entry.queues.push(*priority);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue