diff --git a/dep/imgui/src/imgui_demo.cpp b/dep/imgui/src/imgui_demo.cpp index 258f9283e..6f78d37d1 100644 --- a/dep/imgui/src/imgui_demo.cpp +++ b/dep/imgui/src/imgui_demo.cpp @@ -3581,7 +3581,7 @@ static void DemoWindowWidgetsText() static float custom_size = 16.0f; ImGui::SliderFloat("custom_size", &custom_size, 10.0f, 100.0f, "%.0f"); ImGui::Text("ImGui::PushFont(nullptr, custom_size);"); - ImGui::PushFont(NULL, custom_size); + ImGui::PushFont(NULL, custom_size, -1.0f); ImGui::Text("FontSize = %.2f (== %.2f * global_scale)", ImGui::GetFontSize(), custom_size); ImGui::PopFont(); @@ -3589,14 +3589,14 @@ static void DemoWindowWidgetsText() static float custom_scale = 1.0f; ImGui::SliderFloat("custom_scale", &custom_scale, 0.5f, 4.0f, "%.2f"); ImGui::Text("ImGui::PushFont(nullptr, style.FontSizeBase * custom_scale);"); - ImGui::PushFont(NULL, style.FontSizeBase * custom_scale); + ImGui::PushFont(NULL, style.FontSizeBase * custom_scale, -1.0f); ImGui::Text("FontSize = %.2f (== style.FontSizeBase * %.2f * global_scale)", ImGui::GetFontSize(), custom_scale); ImGui::PopFont(); ImGui::SeparatorText(""); for (float scaling = 0.5f; scaling <= 4.0f; scaling += 0.5f) { - ImGui::PushFont(NULL, style.FontSizeBase * scaling); + ImGui::PushFont(NULL, style.FontSizeBase * scaling, -1.0f); ImGui::Text("FontSize = %.2f (== style.FontSizeBase * %.2f * global_scale)", ImGui::GetFontSize(), scaling); ImGui::PopFont(); } diff --git a/src/core/fullscreenui_widgets.cpp b/src/core/fullscreenui_widgets.cpp index ab159894d..b07e6641f 100644 --- a/src/core/fullscreenui_widgets.cpp +++ b/src/core/fullscreenui_widgets.cpp @@ -1039,6 +1039,14 @@ void FullscreenUI::EndLayout() s_state.progress_dialog.Draw(); s_state.message_dialog.Draw(); +#if 0 + if (HasActiveWindow()) + { + s_state.left_fullscreen_footer_text.append_format("FPS: {:.2f} ({:.3f} ms)", GImGui->IO.Framerate, + 1000.0f / GImGui->IO.Framerate); + } +#endif + DrawFullscreenFooter(); PopResetLayout(); diff --git a/src/util/gpu_device.cpp b/src/util/gpu_device.cpp index 9476de8a5..165a9c7f1 100644 --- a/src/util/gpu_device.cpp +++ b/src/util/gpu_device.cpp @@ -319,12 +319,12 @@ void GPUSwapChain::ThrottlePresentation() // Allow it to fall behind/run ahead up to 2*period. Sleep isn't that precise, plus we need to // allow time for the actual rendering. const u64 max_variance = sleep_period * 2; - if (static_cast(std::abs(static_cast(current_ts - m_last_frame_displayed_time))) > max_variance) - m_last_frame_displayed_time = current_ts + sleep_period; + if (static_cast(std::abs(static_cast(current_ts - m_next_throttle_time))) > max_variance) + m_next_throttle_time = current_ts + sleep_period; else - m_last_frame_displayed_time += sleep_period; + m_next_throttle_time += sleep_period; - Timer::SleepUntil(m_last_frame_displayed_time, false); + Timer::SleepUntil(m_next_throttle_time, false); } GPUDevice::GPUDevice() diff --git a/src/util/gpu_device.h b/src/util/gpu_device.h index 581f92949..f0ea465b1 100644 --- a/src/util/gpu_device.h +++ b/src/util/gpu_device.h @@ -502,6 +502,7 @@ protected: bool m_allow_present_throttle = false; u64 m_last_frame_displayed_time = 0; + u64 m_next_throttle_time = 0; }; class GPUDevice