diff options
author | Liam <byteslice@airmail.cc> | 2023-12-03 20:02:20 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-03 22:43:54 +0100 |
commit | 382cf087a09e1095f07c14aabc8e432ec0a1a2c1 (patch) | |
tree | d028d018e39466e041992d2aad804914355758ae /src/video_core/renderer_vulkan/vk_present_manager.cpp | |
parent | Merge pull request #12094 from ameerj/gl-buffer-cache-batch-vtx (diff) | |
download | yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar.gz yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar.bz2 yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar.lz yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar.xz yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.tar.zst yuzu-382cf087a09e1095f07c14aabc8e432ec0a1a2c1.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_present_manager.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_present_manager.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 2ef36583b..8e4c74b5c 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -172,13 +172,12 @@ void PresentManager::Present(Frame* frame) { }); } -void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, bool is_srgb, - VkFormat image_view_format, VkRenderPass rd) { +void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, VkFormat image_view_format, + VkRenderPass rd) { auto& dld = device.GetLogical(); frame->width = width; frame->height = height; - frame->is_srgb = is_srgb; frame->image = memory_allocator.CreateImage({ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, @@ -289,7 +288,7 @@ void PresentManager::PresentThread(std::stop_token token) { } void PresentManager::RecreateSwapchain(Frame* frame) { - swapchain.Create(*surface, frame->width, frame->height, frame->is_srgb); + swapchain.Create(*surface, frame->width, frame->height); image_count = swapchain.GetImageCount(); } @@ -319,12 +318,12 @@ void PresentManager::CopyToSwapchain(Frame* frame) { void PresentManager::CopyToSwapchainImpl(Frame* frame) { MICROPROFILE_SCOPE(Vulkan_CopyToSwapchain); - // If the size or colorspace of the incoming frames has changed, recreate the swapchain + // If the size of the incoming frames has changed, recreate the swapchain // to account for that. - const bool srgb_changed = swapchain.NeedsRecreation(frame->is_srgb); + const bool is_suboptimal = swapchain.NeedsRecreation(); const bool size_changed = swapchain.GetWidth() != frame->width || swapchain.GetHeight() != frame->height; - if (srgb_changed || size_changed) { + if (is_suboptimal || size_changed) { RecreateSwapchain(frame); } |