| 352 | } |
| 353 | |
| 354 | static VkSurfaceFormatKHR ChooseSurfaceFormat() |
| 355 | { |
| 356 | assert(!g_SurfaceFormats.empty()); |
| 357 | |
| 358 | if((g_SurfaceFormats.size() == 1) && (g_SurfaceFormats[0].format == VK_FORMAT_UNDEFINED)) |
| 359 | { |
| 360 | VkSurfaceFormatKHR result = { VK_FORMAT_B8G8R8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR }; |
| 361 | return result; |
| 362 | } |
| 363 | |
| 364 | for(const auto& format : g_SurfaceFormats) |
| 365 | { |
| 366 | if((format.format == VK_FORMAT_B8G8R8A8_UNORM) && |
| 367 | (format.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)) |
| 368 | { |
| 369 | return format; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | return g_SurfaceFormats[0]; |
| 374 | } |
| 375 | |
| 376 | VkPresentModeKHR ChooseSwapPresentMode() |
| 377 | { |
no test coverage detected