platform/windows: change dwmflush default, add autodetection

On each re/init, query the active monitor refresh rate via
DwmGetCompositionTimingInfo. If the client requested framerate exceeds
the host monitor refresh, automatically disable DwmFlush.

This avoids the problem by which DwmFlush would constrain the client
FPS if the host monitor runs at a lower refresh rate, thus allowing
the feature to be enabled by default.

If there are other issues caused by DwmFlush for certain systems,
it can still be disabled via configuration.
This commit is contained in:
Conn O'Griofa
2022-05-20 16:25:09 +01:00
parent 211b25848f
commit 2d969c2ccc
5 changed files with 29 additions and 11 deletions

View File

@@ -226,10 +226,10 @@ video_t video {
1,
-1 }, // vt
{}, // encoder
{}, // adapter_name
{}, // output_name
false // dwmflush
{}, // encoder
{}, // adapter_name
{}, // output_name
true // dwmflush
};
audio_t audio {};