summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_swapchain.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-27 03:11:31 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:29 +0200
commit53acdda772a8b7650c46ba9d998119b8c8e30844 (patch)
tree5f98a9a19093704513fffd17dc7326cdbf5e6f91 /src/video_core/renderer_vulkan/vk_swapchain.h
parentvk_compute_pass: Fix -Wshadow warning (diff)
downloadyuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar.gz
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar.bz2
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar.lz
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar.xz
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.tar.zst
yuzu-53acdda772a8b7650c46ba9d998119b8c8e30844.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h
index adc8d27cf..b38fd9dc2 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.h
+++ b/src/video_core/renderer_vulkan/vk_swapchain.h
@@ -28,14 +28,20 @@ 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;
+ bool HasDifferentLayout(u32 width, u32 height, bool is_srgb) const {
+ return extent.width != width || extent.height != height || current_srgb != is_srgb;
+ }
+
+ /// Returns true when the image has to be recreated.
+ bool NeedsRecreate() const {
+ return needs_recreate;
+ }
VkExtent2D GetSize() const {
return extent;
@@ -61,10 +67,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 +94,8 @@ private:
VkFormat image_format{};
VkExtent2D extent{};
- u32 current_width{};
- u32 current_height{};
bool current_srgb{};
+ bool needs_recreate{};
};
} // namespace Vulkan