diff --git a/src/common/rendering/vulkan/system/vk_swapchain.cpp b/src/common/rendering/vulkan/system/vk_swapchain.cpp index fd21c462e..f44139b1f 100644 --- a/src/common/rendering/vulkan/system/vk_swapchain.cpp +++ b/src/common/rendering/vulkan/system/vk_swapchain.cpp @@ -250,7 +250,7 @@ void VulkanSwapChain::CreateViews() bool VulkanSwapChain::IsHdrModeActive() const { - return swapChainFormat.colorSpace == VK_COLOR_SPACE_HDR10_ST2084_EXT || swapChainFormat.colorSpace == VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT; + return swapChainFormat.colorSpace == VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT; } void VulkanSwapChain::SelectFormat() @@ -276,16 +276,6 @@ void VulkanSwapChain::SelectFormat() return; } } - - // For older drivers that reported the wrong colorspace - for (const auto &format : surfaceFormats) - { - if (format.format == VK_FORMAT_R16G16B16A16_SFLOAT && format.colorSpace == VK_COLOR_SPACE_HDR10_ST2084_EXT) - { - swapChainFormat = format; - return; - } - } } for (const auto &format : surfaceFormats) diff --git a/wadsrc/static/shaders/pp/present.fp b/wadsrc/static/shaders/pp/present.fp index 4266757f9..2fed289cd 100644 --- a/wadsrc/static/shaders/pp/present.fp +++ b/wadsrc/static/shaders/pp/present.fp @@ -31,9 +31,14 @@ vec4 Dither(vec4 c) return vec4(floor(c.rgb * ColorScale + threshold) / ColorScale, c.a); } -vec4 sRGBtoLinear(vec4 c) +vec3 sRGBtoLinear(vec3 c) { - return vec4(mix(c.rgb / 12.92, pow((c.rgb + 0.055) / 1.055, vec3(2.4)), step(c.rgb, vec3(0.04045))), c.a); + return mix(c / 12.92, pow((c + 0.055) / 1.055, vec3(2.4)), step(vec3(0.04045), c)); +} + +vec3 sRGBtoscRGBLinear(vec3 c) +{ + return pow(c, vec3(2.2)) * 1.1; } vec4 ApplyHdrMode(vec4 c) @@ -41,7 +46,7 @@ vec4 ApplyHdrMode(vec4 c) if (HdrMode == 0) return c; else - return sRGBtoLinear(c); + return vec4(sRGBtoscRGBLinear(c.rgb), c.a); } void main()