diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-06 22:41:42 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-12-06 22:42:08 -0300 |
| commit | f632d00eb1add39f43617d147466bb310ce646fd (patch) | |
| tree | 0bd8a66dfa228867e9f104743420d3afc19c47ae /src/video_core/renderer_vulkan/vk_swapchain.h | |
| parent | d49ed4a421f7b4a7649c91f136108aa24ebebd4f (diff) | |
vk_swapchain: Add support for swapping sRGB
We don't know until the game is running if it's using an sRGB color
space or not. Add support for hot-swapping swapchain surface formats.
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.h')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_swapchain.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h index 2ad84f185..a1e7938d2 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.h +++ b/src/video_core/renderer_vulkan/vk_swapchain.h @@ -24,7 +24,7 @@ public: ~VKSwapchain(); /// Creates (or recreates) the swapchain with a given size. - void Create(u32 width, u32 height); + void Create(u32 width, u32 height, bool srgb); /// Acquires the next image in the swapchain, waits as needed. void AcquireNextImage(); @@ -60,8 +60,13 @@ public: return image_format; } + bool GetSrgbState() const { + return current_srgb; + } + private: - void CreateSwapchain(const vk::SurfaceCapabilitiesKHR& capabilities, u32 width, u32 height); + void CreateSwapchain(const vk::SurfaceCapabilitiesKHR& capabilities, u32 width, u32 height, + bool srgb); void CreateSemaphores(); void CreateImageViews(); @@ -87,6 +92,7 @@ private: u32 current_width{}; u32 current_height{}; + bool current_srgb{}; }; } // namespace Vulkan |
