diff options
| author | OatmealDome <julian@oatmealdome.me> | 2024-12-03 20:49:50 -0500 |
|---|---|---|
| committer | OatmealDome <julian@oatmealdome.me> | 2024-12-03 20:49:50 -0500 |
| commit | e6f335bfcf3179c5879f6d9ca688ecb360eda39d (patch) | |
| tree | 397b0f5c830ffdb8ff73c8918e07a6e739bb6de9 /Source/Core/VideoBackends | |
| parent | cf29214c0335d124aa95b88a8994d079631afb45 (diff) | |
VKSwapChain: Always use surface formats with a normal sRGB color space if not RGBA16F
Co-authored-by: TellowKrinkle <tellowkrinkle@gmail.com>
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/VKSwapChain.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VKSwapChain.cpp b/Source/Core/VideoBackends/Vulkan/VKSwapChain.cpp index 1005cc034a..bbe94944fb 100644 --- a/Source/Core/VideoBackends/Vulkan/VKSwapChain.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKSwapChain.cpp @@ -176,18 +176,20 @@ bool SwapChain::SelectSurfaceFormat() // because we already apply gamma ourselves, and we might not use sRGB gamma. // Force using a linear format instead, if this is the case. VkFormat format = VKTexture::GetLinearFormat(surface_format.format); - if (format == VK_FORMAT_R8G8B8A8_UNORM) - surface_format_RGBA8 = &surface_format; - else if (format == VK_FORMAT_B8G8R8A8_UNORM) - surface_format_BGRA8 = &surface_format; - else if (format == VK_FORMAT_A2B10G10R10_UNORM_PACK32 && - surface_format.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) - surface_format_RGB10_A2 = &surface_format; + if (surface_format.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) + { + if (format == VK_FORMAT_R8G8B8A8_UNORM) + surface_format_RGBA8 = &surface_format; + else if (format == VK_FORMAT_B8G8R8A8_UNORM) + surface_format_BGRA8 = &surface_format; + else if (format == VK_FORMAT_A2B10G10R10_UNORM_PACK32) + surface_format_RGB10_A2 = &surface_format; + } else if (format == VK_FORMAT_R16G16B16A16_SFLOAT && surface_format.colorSpace == VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT) + { surface_format_RGBA16F_scRGB = &surface_format; - else - continue; + } } const VkSurfaceFormatKHR* surface_format = nullptr; |
