| 1353 | } |
| 1354 | |
| 1355 | bool isDeviceSuitable(VkPhysicalDevice device) { |
| 1356 | QueueFamilyIndices indices = findQueueFamilies(device); |
| 1357 | |
| 1358 | bool extensionsSupported = checkDeviceExtensionSupport(device); |
| 1359 | |
| 1360 | bool swapChainAdequate = false; |
| 1361 | if (extensionsSupported) { |
| 1362 | SwapChainSupportDetails swapChainSupport = querySwapChainSupport(device); |
| 1363 | swapChainAdequate = !swapChainSupport.formats.empty() && !swapChainSupport.presentModes.empty(); |
| 1364 | } |
| 1365 | |
| 1366 | VkPhysicalDeviceFeatures supportedFeatures; |
| 1367 | vkGetPhysicalDeviceFeatures(device, &supportedFeatures); |
| 1368 | |
| 1369 | return indices.isComplete() && extensionsSupported && swapChainAdequate && supportedFeatures.samplerAnisotropy; |
| 1370 | } |
| 1371 | |
| 1372 | bool checkDeviceExtensionSupport(VkPhysicalDevice device) { |
| 1373 | uint32_t extensionCount; |
nothing calls this directly
no test coverage detected