Replace Vblank Divider with Vblank Frequency (#3532)

This commit is contained in:
UltraDaCat
2025-09-07 00:00:26 +02:00
committed by GitHub
parent 0e7e100a7e
commit 5e3ffeafbe
7 changed files with 34 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
@@ -269,8 +269,7 @@ void VideoOutDriver::SubmitFlipInternal(VideoOutPort* port, s32 index, s64 flip_
}
void VideoOutDriver::PresentThread(std::stop_token token) {
static constexpr std::chrono::nanoseconds VblankPeriod{16666667};
const auto vblank_period = VblankPeriod / Config::vblankDiv();
const std::chrono::nanoseconds vblank_period(1000000000 / Config::vblankFreq());
Common::SetCurrentThreadName("shadPS4:PresentThread");
Common::SetCurrentThreadRealtime(vblank_period);