mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-16 04:15:48 -04:00
HostDisplay: Manually throttle fullscreen UI presentation
Fixes flickering screen in fullscreen with Vulkan.
This commit is contained in:
@ -218,7 +218,7 @@ bool MainWindow::createDisplay(bool fullscreen, bool render_to_main)
|
||||
|
||||
g_emu_thread->connectDisplaySignals(m_display_widget);
|
||||
|
||||
if (!g_host_display->CreateDevice(wi.value()))
|
||||
if (!g_host_display->CreateDevice(wi.value(), System::ShouldUseVSync()))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to create host display device context."));
|
||||
destroyDisplayWidget(true);
|
||||
|
@ -754,18 +754,12 @@ bool EmuThread::acquireHostDisplay(RenderAPI api)
|
||||
|
||||
m_is_exclusive_fullscreen = g_host_display->IsFullscreen();
|
||||
|
||||
if (m_run_fullscreen_ui)
|
||||
if (m_run_fullscreen_ui && !FullscreenUI::Initialize())
|
||||
{
|
||||
if (!FullscreenUI::Initialize())
|
||||
{
|
||||
Log_ErrorPrint("Failed to initialize fullscreen UI");
|
||||
releaseHostDisplay();
|
||||
m_run_fullscreen_ui = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// start with vsync on
|
||||
g_host_display->SetVSync(true);
|
||||
Log_ErrorPrint("Failed to initialize fullscreen UI");
|
||||
releaseHostDisplay();
|
||||
m_run_fullscreen_ui = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1439,7 +1433,11 @@ void EmuThread::run()
|
||||
m_event_loop->processEvents(QEventLoop::AllEvents);
|
||||
CommonHost::PumpMessagesOnCPUThread();
|
||||
if (g_host_display)
|
||||
{
|
||||
renderDisplay(false);
|
||||
if (!g_host_display->IsVsyncEnabled())
|
||||
g_host_display->ThrottlePresentation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user