| 1323 | } |
| 1324 | |
| 1325 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1326 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1327 | |
| 1328 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1329 | |
| 1330 | bool swapChainAdequate = false; |
| 1331 | if (extensionsSupported) { |
| 1332 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1333 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1334 | } |
| 1335 | |
| 1336 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1337 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1338 | |
| 1339 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1340 | } |
| 1341 | |
| 1342 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1343 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected