diff options
| author | Alexander Orzechowski <alex@ozal.ski> | 2022-12-13 13:08:02 -0500 |
|---|---|---|
| committer | Alexander Orzechowski <alex@ozal.ski> | 2022-12-13 13:23:35 -0500 |
| commit | 3cc3176ad6549c412f2370f496f00f1f6849275c (patch) | |
| tree | 33c90504a36af40b42080df1822e909a8399373f /src/video_core/renderer_vulkan/vk_swapchain.h | |
| parent | d5f53da79d944869eb88416494ecf10a47eee90d (diff) | |
video_core/vulkan: Explicity check swapchain size when deciding to recreate
Vulkan for whatever reason does not return VK_ERROR_OUT_OF_DATE_KHR when
the swapchain is the wrong size. Explicity make sure the size is indeed
up to date to workaround this.
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.h')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_swapchain.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h index 111b3902d..caf1ff32b 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.h +++ b/src/video_core/renderer_vulkan/vk_swapchain.h @@ -80,9 +80,16 @@ public: return *present_semaphores[frame_index]; } + u32 GetWidth() const { + return width; + } + + u32 GetHeight() const { + return height; + } + private: - void CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height, - bool srgb); + void CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, bool srgb); void CreateSemaphores(); void CreateImageViews(); @@ -105,6 +112,9 @@ private: std::vector<u64> resource_ticks; std::vector<vk::Semaphore> present_semaphores; + u32 width; + u32 height; + u32 image_index{}; u32 frame_index{}; |
