| 1479 | } |
| 1480 | |
| 1481 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1482 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1483 | |
| 1484 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1485 | |
| 1486 | bool swapChainAdequate = false; |
| 1487 | if (extensionsSupported) { |
| 1488 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1489 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1490 | } |
| 1491 | |
| 1492 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1493 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1494 | |
| 1495 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1496 | } |
| 1497 | |
| 1498 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1499 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected