mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-05 18:23:16 +00:00
keep framerate stable even without vsync (#2165)
This commit is contained in:
parent
56a6c95730
commit
8695383d35
7 changed files with 38 additions and 17 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue