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

Method findQueueFamilies

code/21_index_buffer.cpp:1032–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030 }
1031
1032 QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) {
1033 QueueFamilyIndices indices;
1034
1035 uint32_t queueFamilyCount = 0;
1036 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
1037
1038 std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount);
1039 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data());
1040
1041 int i = 0;
1042 for (const auto& queueFamily : queueFamilies) {
1043 if (queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
1044 indices.graphicsFamily = i;
1045 }
1046
1047 VkBool32 presentSupport = false;
1048 vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &presentSupport);
1049
1050 if (presentSupport) {
1051 indices.presentFamily = i;
1052 }
1053
1054 if (indices.isComplete()) {
1055 break;
1056 }
1057
1058 i++;
1059 }
1060
1061 return indices;
1062 }
1063
1064 std::vector<const char*> getRequiredExtensions() {
1065 uint32_t glfwExtensionCount = 0;

Callers

nothing calls this directly

Calls 1

isCompleteMethod · 0.45

Tested by

no test coverage detected