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

Method findQueueFamilies

code/19_vertex_buffer.cpp:951–981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949 }
950
951 QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) {
952 QueueFamilyIndices indices;
953
954 uint32_t queueFamilyCount = 0;
955 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
956
957 std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount);
958 vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data());
959
960 int i = 0;
961 for (const auto& queueFamily : queueFamilies) {
962 if (queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
963 indices.graphicsFamily = i;
964 }
965
966 VkBool32 presentSupport = false;
967 vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &presentSupport);
968
969 if (presentSupport) {
970 indices.presentFamily = i;
971 }
972
973 if (indices.isComplete()) {
974 break;
975 }
976
977 i++;
978 }
979
980 return indices;
981 }
982
983 std::vector<const char*> getRequiredExtensions() {
984 uint32_t glfwExtensionCount = 0;

Callers

nothing calls this directly

Calls 1

isCompleteMethod · 0.45

Tested by

no test coverage detected