GPUDevice: Make vsync actually tear-free

Apparently users prefer stutter over tearing...
This commit is contained in:
Stenzek
2024-05-23 13:52:24 +10:00
parent dd98b630ea
commit 6cad97b404
17 changed files with 178 additions and 87 deletions

View File

@ -276,10 +276,11 @@ bool GPUDevice::IsSameRenderAPI(RenderAPI lhs, RenderAPI rhs)
}
bool GPUDevice::Create(std::string_view adapter, std::string_view shader_cache_path, u32 shader_cache_version,
bool debug_device, bool vsync, bool threaded_presentation,
bool debug_device, bool vsync, bool vsync_prefer_triple_buffer, bool threaded_presentation,
std::optional<bool> exclusive_fullscreen_control, FeatureMask disabled_features, Error* error)
{
m_vsync_enabled = vsync;
m_vsync_prefer_triple_buffer = vsync_prefer_triple_buffer;
m_debug_device = debug_device;
if (!AcquireWindow(true))
@ -590,7 +591,7 @@ void GPUDevice::RenderImGui()
}
}
void GPUDevice::SetVSyncEnabled(bool enabled)
void GPUDevice::SetVSyncEnabled(bool enabled, bool prefer_triple_buffer)
{
m_vsync_enabled = enabled;
}