Finished vulkanFindQueues

This commit is contained in:
georgemoralis 2023-09-21 12:41:51 +03:00
parent 3768dfabfc
commit 90dc454440
2 changed files with 53 additions and 1 deletions

View File

@ -37,6 +37,9 @@ struct VulkanQueues {
u32 family_count = 0; u32 family_count = 0;
std::vector<VulkanQueueInfo> available; std::vector<VulkanQueueInfo> available;
std::vector<VulkanQueueInfo> graphics; std::vector<VulkanQueueInfo> graphics;
std::vector<VulkanQueueInfo> compute;
std::vector<VulkanQueueInfo> transfer;
std::vector<VulkanQueueInfo> present;
std::vector<u32> family_used; std::vector<u32> family_used;
}; };

View File

@ -158,7 +158,56 @@ Emulator::VulkanQueues Graphics::Vulkan::vulkanFindQueues(VkPhysicalDevice devic
family++; family++;
} }
// TODO finish it u32 index = 0;
for (u32 i = 0; i < VULKAN_QUEUE_GRAPHICS_NUM; i++) {
for (const auto& idx : qs.available) {
if (idx.is_graphics)
{
qs.family_used[qs.available.at(index).family]++;
qs.graphics.push_back(qs.available.at(index));
qs.available.erase(qs.available.begin()+index);
break;
}
index++;
}
}
index = 0;
for (u32 i = 0; i < VULKAN_QUEUE_COMPUTE_NUM; i++) {
for (const auto& idx : qs.available) {
if (idx.is_graphics) {
qs.family_used[qs.available.at(index).family]++;
qs.compute.push_back(qs.available.at(index));
qs.available.erase(qs.available.begin() + index);
break;
}
index++;
}
}
index = 0;
for (uint32_t i = 0; i < VULKAN_QUEUE_TRANSFER_NUM; i++) {
for (const auto& idx : qs.available) {
if (idx.is_graphics) {
qs.family_used[qs.available.at(index).family]++;
qs.transfer.push_back(qs.available.at(index));
qs.available.erase(qs.available.begin() + index);
break;
}
index++;
}
}
index = 0;
for (uint32_t i = 0; i < VULKAN_QUEUE_PRESENT_NUM; i++) {
for (const auto& idx : qs.available) {
if (idx.is_graphics) {
qs.family_used[qs.available.at(index).family]++;
qs.present.push_back(qs.available.at(index));
qs.available.erase(qs.available.begin() + index);
break;
}
index++;
}
}
return qs; return qs;
} }