MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / findQueueFamilies

Method findQueueFamilies

code/28_model_loading.cpp:1514–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1512 }
1513
1514 QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) {
1515 QueueFamilyIndices indices;
1516
1517 uint32_t queueFamilyCount = 0;
1518 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
1519
1520 std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount);
1521 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data());
1522
1523 int i = 0;
1524 for (const auto& queueFamily : queueFamilies) {
1525 if (queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
1526 indices.graphicsFamily = i;
1527 }
1528
1529 VkBool32 presentSupport = false;
1530 vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &presentSupport);
1531
1532 if (presentSupport) {
1533 indices.presentFamily = i;
1534 }
1535
1536 if (indices.isComplete()) {
1537 break;
1538 }
1539
1540 i++;
1541 }
1542
1543 return indices;
1544 }
1545
1546 std::vector<const char*> getRequiredExtensions() {
1547 uint32_t glfwExtensionCount = 0;

Callers

nothing calls this directly

Calls 1

isCompleteMethod · 0.45

Tested by

no test coverage detected