| 1433 | } |
| 1434 | |
| 1435 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1436 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1437 | |
| 1438 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1439 | |
| 1440 | bool swapChainAdequate = false; |
| 1441 | if (extensionsSupported) { |
| 1442 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1443 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1444 | } |
| 1445 | |
| 1446 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1447 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1448 | |
| 1449 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1450 | } |
| 1451 | |
| 1452 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1453 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected