summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_swapchain.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-07-25 20:39:04 +0200
committerGitHub <noreply@github.com>2021-07-25 20:39:04 +0200
commit98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f (patch)
tree816faa96c2c4d291825063433331a8ea4b3d08f1 /src/video_core/renderer_vulkan/vk_swapchain.h
parentMerge pull request #6699 from lat9nq/common-threads (diff)
parentshader: Support out of bound local memory reads and immediate writes (diff)
downloadyuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.gz
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.bz2
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.lz
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.xz
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.zst
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.h')
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h
index adc8d27cf..35c2cdc14 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.h
+++ b/src/video_core/renderer_vulkan/vk_swapchain.h
@@ -28,14 +28,25 @@ public:
void Create(u32 width, u32 height, bool srgb);
/// Acquires the next image in the swapchain, waits as needed.
- bool AcquireNextImage();
+ void AcquireNextImage();
- /// Presents the rendered image to the swapchain. Returns true when the swapchains had to be
- /// recreated. Takes responsability for the ownership of fence.
- bool Present(VkSemaphore render_semaphore);
+ /// Presents the rendered image to the swapchain.
+ void Present(VkSemaphore render_semaphore);
- /// Returns true when the framebuffer layout has changed.
- bool HasFramebufferChanged(const Layout::FramebufferLayout& framebuffer) const;
+ /// Returns true when the color space has changed.
+ bool HasColorSpaceChanged(bool is_srgb) const {
+ return current_srgb != is_srgb;
+ }
+
+ /// Returns true when the swapchain is outdated.
+ bool IsOutDated() const {
+ return is_outdated;
+ }
+
+ /// Returns true when the swapchain is suboptimal.
+ bool IsSubOptimal() const {
+ return is_suboptimal;
+ }
VkExtent2D GetSize() const {
return extent;
@@ -61,10 +72,6 @@ public:
return image_format;
}
- bool GetSrgbState() const {
- return current_srgb;
- }
-
private:
void CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height,
bool srgb);
@@ -92,9 +99,9 @@ private:
VkFormat image_format{};
VkExtent2D extent{};
- u32 current_width{};
- u32 current_height{};
bool current_srgb{};
+ bool is_outdated{};
+ bool is_suboptimal{};
};
} // namespace Vulkan