| 1623 | } |
| 1624 | |
| 1625 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1626 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1627 | |
| 1628 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1629 | |
| 1630 | bool swapChainAdequate = false; |
| 1631 | if (extensionsSupported) { |
| 1632 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1633 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1634 | } |
| 1635 | |
| 1636 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1637 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1638 | |
| 1639 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1640 | } |
| 1641 | |
| 1642 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1643 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected