mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 13:48:40 +00:00
keep framerate stable even without vsync (#2165)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "core/libraries/kernel/time.h"
|
||||
#include "core/libraries/videoout/driver.h"
|
||||
#include "core/libraries/videoout/videoout_error.h"
|
||||
#include "imgui/renderer/imgui_core.h"
|
||||
#include "video_core/renderer_vulkan/vk_presenter.h"
|
||||
|
||||
extern std::unique_ptr<Vulkan::Presenter> presenter;
|
||||
@@ -297,10 +298,12 @@ void VideoOutDriver::PresentThread(std::stop_token token) {
|
||||
if (vblank_status.count % (main_port.flip_rate + 1) == 0) {
|
||||
const auto request = receive_request();
|
||||
if (!request) {
|
||||
if (!main_port.is_open) {
|
||||
DrawBlankFrame();
|
||||
} else {
|
||||
DrawLastFrame();
|
||||
if (timer.GetTotalWait().count() < 0) { // Dont draw too fast
|
||||
if (!main_port.is_open) {
|
||||
DrawBlankFrame();
|
||||
} else if (ImGui::Core::MustKeepDrawing()) {
|
||||
DrawLastFrame();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Flip(request);
|
||||
|
||||
Reference in New Issue
Block a user