mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 19:25:42 -04:00
GPU: Further improve vsync handling
This commit is contained in:
@ -1754,7 +1754,7 @@ void EmuThread::run()
|
||||
if (g_gpu_device)
|
||||
{
|
||||
System::PresentDisplay(false, false);
|
||||
if (!g_gpu_device->IsVSyncEnabled())
|
||||
if (!g_gpu_device->IsVSyncModeBlocking())
|
||||
g_gpu_device->ThrottlePresentation();
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "core/system.h"
|
||||
|
||||
#include "common/byte_stream.h"
|
||||
#include "common/log.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QMetaObject>
|
||||
@ -38,6 +39,8 @@
|
||||
#include "common/windows_headers.h"
|
||||
#endif
|
||||
|
||||
Log_SetChannel(QtUtils);
|
||||
|
||||
namespace QtUtils {
|
||||
|
||||
QFrame* CreateHorizontalLine(QWidget* parent)
|
||||
@ -365,6 +368,11 @@ std::optional<WindowInfo> GetWindowInfoForWidget(QWidget* widget)
|
||||
wi.surface_width = static_cast<u32>(static_cast<qreal>(widget->width()) * dpr);
|
||||
wi.surface_height = static_cast<u32>(static_cast<qreal>(widget->height()) * dpr);
|
||||
wi.surface_scale = static_cast<float>(dpr);
|
||||
|
||||
// Query refresh rate, we need it for sync.
|
||||
wi.surface_refresh_rate = WindowInfo::QueryRefreshRateForWindow(wi).value_or(0.0f);
|
||||
INFO_LOG("Surface refresh rate: {} hz", wi.surface_refresh_rate);
|
||||
|
||||
return wi;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user