| 1573 | } |
| 1574 | |
| 1575 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1576 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1577 | |
| 1578 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1579 | |
| 1580 | bool swapChainAdequate = false; |
| 1581 | if (extensionsSupported) { |
| 1582 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1583 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1584 | } |
| 1585 | |
| 1586 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1587 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1588 | |
| 1589 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1590 | } |
| 1591 | |
| 1592 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1593 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected