diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_swapchain.cpp | 15 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 6 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index d12669c9d..51d9e8f68 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -147,7 +147,7 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { | |||
| 147 | const auto recreate_swapchain = [&] { | 147 | const auto recreate_swapchain = [&] { |
| 148 | if (!has_been_recreated) { | 148 | if (!has_been_recreated) { |
| 149 | has_been_recreated = true; | 149 | has_been_recreated = true; |
| 150 | scheduler.WaitWorker(); | 150 | scheduler.Finish(); |
| 151 | } | 151 | } |
| 152 | const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); | 152 | const Layout::FramebufferLayout layout = render_window.GetFramebufferLayout(); |
| 153 | swapchain.Create(layout.width, layout.height, is_srgb); | 153 | swapchain.Create(layout.width, layout.height, is_srgb); |
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index a69ae7725..706d9ba74 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp | |||
| @@ -36,7 +36,8 @@ VkPresentModeKHR ChooseSwapPresentMode(vk::Span<VkPresentModeKHR> modes) { | |||
| 36 | // Mailbox (triple buffering) doesn't lock the application like fifo (vsync), | 36 | // Mailbox (triple buffering) doesn't lock the application like fifo (vsync), |
| 37 | // prefer it if vsync option is not selected | 37 | // prefer it if vsync option is not selected |
| 38 | const auto found_mailbox = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR); | 38 | const auto found_mailbox = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR); |
| 39 | if (found_mailbox != modes.end() && !Settings::values.use_vsync.GetValue()) { | 39 | if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Borderless && |
| 40 | found_mailbox != modes.end() && !Settings::values.use_vsync.GetValue()) { | ||
| 40 | return VK_PRESENT_MODE_MAILBOX_KHR; | 41 | return VK_PRESENT_MODE_MAILBOX_KHR; |
| 41 | } | 42 | } |
| 42 | if (!Settings::values.use_speed_limit.GetValue()) { | 43 | if (!Settings::values.use_speed_limit.GetValue()) { |
| @@ -156,8 +157,16 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, u3 | |||
| 156 | present_mode = ChooseSwapPresentMode(present_modes); | 157 | present_mode = ChooseSwapPresentMode(present_modes); |
| 157 | 158 | ||
| 158 | u32 requested_image_count{capabilities.minImageCount + 1}; | 159 | u32 requested_image_count{capabilities.minImageCount + 1}; |
| 159 | if (capabilities.maxImageCount > 0 && requested_image_count > capabilities.maxImageCount) { | 160 | // Ensure Tripple buffering if possible. |
| 160 | requested_image_count = capabilities.maxImageCount; | 161 | if (capabilities.maxImageCount > 0) { |
| 162 | if (requested_image_count > capabilities.maxImageCount) { | ||
| 163 | requested_image_count = capabilities.maxImageCount; | ||
| 164 | } else { | ||
| 165 | requested_image_count = | ||
| 166 | std::max(requested_image_count, std::min(3U, capabilities.maxImageCount)); | ||
| 167 | } | ||
| 168 | } else { | ||
| 169 | requested_image_count = std::max(requested_image_count, 3U); | ||
| 161 | } | 170 | } |
| 162 | VkSwapchainCreateInfoKHR swapchain_ci{ | 171 | VkSwapchainCreateInfoKHR swapchain_ci{ |
| 163 | .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, | 172 | .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c63ce3a30..4146ebc2c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <cinttypes> | 4 | #include <cinttypes> |
| 5 | #include <clocale> | 5 | #include <clocale> |
| 6 | #include <cmath> | ||
| 6 | #include <memory> | 7 | #include <memory> |
| 7 | #include <thread> | 8 | #include <thread> |
| 8 | #ifdef __APPLE__ | 9 | #ifdef __APPLE__ |
| @@ -3451,9 +3452,10 @@ void GMainWindow::UpdateStatusBar() { | |||
| 3451 | } | 3452 | } |
| 3452 | if (!Settings::values.use_speed_limit) { | 3453 | if (!Settings::values.use_speed_limit) { |
| 3453 | game_fps_label->setText( | 3454 | game_fps_label->setText( |
| 3454 | tr("Game: %1 FPS (Unlocked)").arg(results.average_game_fps, 0, 'f', 0)); | 3455 | tr("Game: %1 FPS (Unlocked)").arg(std::round(results.average_game_fps), 0, 'f', 0)); |
| 3455 | } else { | 3456 | } else { |
| 3456 | game_fps_label->setText(tr("Game: %1 FPS").arg(results.average_game_fps, 0, 'f', 0)); | 3457 | game_fps_label->setText( |
| 3458 | tr("Game: %1 FPS").arg(std::round(results.average_game_fps), 0, 'f', 0)); | ||
| 3457 | } | 3459 | } |
| 3458 | emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2)); | 3460 | emu_frametime_label->setText(tr("Frame: %1 ms").arg(results.frametime * 1000.0, 0, 'f', 2)); |
| 3459 | 3461 | ||