| 28 | } |
| 29 | |
| 30 | void VulkanSurfaceInfo::get(VkPhysicalDevice device, VkSurfaceKHR surface) |
| 31 | { |
| 32 | if (!validSurface) { |
| 33 | return; |
| 34 | } |
| 35 | vkGetPhysicalDeviceSurfaceCapabilitiesKHR(device, surface, &capabilities); |
| 36 | // Present modes |
| 37 | uint32_t presentModeCount; |
| 38 | if (vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, nullptr) == VK_SUCCESS) |
| 39 | { |
| 40 | presentModes.resize(presentModeCount); |
| 41 | if (presentModeCount > 0) |
| 42 | { |
| 43 | vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, presentModes.data()); |
| 44 | } |
| 45 | } |
| 46 | // Surface formats |
| 47 | uint32_t surfaceFormatCount; |
| 48 | if (vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &surfaceFormatCount, nullptr) == VK_SUCCESS) |
| 49 | { |
| 50 | formats.resize(surfaceFormatCount); |
| 51 | if (surfaceFormatCount > 0) |
| 52 | { |
| 53 | vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &surfaceFormatCount, formats.data()); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void VulkanDeviceInfo::readExtensions() |
| 59 | { |
no outgoing calls
no test coverage detected