GPU: Further improve vsync handling

This commit is contained in:
Stenzek
2024-05-24 01:59:35 +10:00
parent 4e922a34a7
commit 42a5fe0a6e
20 changed files with 184 additions and 163 deletions

View File

@ -276,11 +276,10 @@ 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 vsync_prefer_triple_buffer, bool threaded_presentation,
bool debug_device, GPUVSyncMode vsync, 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_vsync_mode = vsync;
m_debug_device = debug_device;
if (!AcquireWindow(true))
@ -591,11 +590,6 @@ void GPUDevice::RenderImGui()
}
}
void GPUDevice::SetVSyncEnabled(bool enabled, bool prefer_triple_buffer)
{
m_vsync_enabled = enabled;
}
void GPUDevice::UploadVertexBuffer(const void* vertices, u32 vertex_size, u32 vertex_count, u32* base_vertex)
{
void* map;
@ -1053,14 +1047,6 @@ void GPUDevice::ThrottlePresentation()
Common::Timer::SleepUntil(m_last_frame_displayed_time, false);
}
std::optional<float> GPUDevice::GetHostRefreshRate()
{
if (m_window_info.surface_refresh_rate > 0.0f)
return m_window_info.surface_refresh_rate;
return WindowInfo::QueryRefreshRateForWindow(m_window_info);
}
bool GPUDevice::SetGPUTimingEnabled(bool enabled)
{
return false;