steamcompmgr: Use presentation hints to determine whether to tear

This commit is contained in:
Joshua Ashton 2022-08-31 12:01:46 +00:00 committed by Joshie
parent d9cab62e80
commit 21ce7baf0f

View file

@ -5437,12 +5437,13 @@ steamcompmgr_main(int argc, char **argv)
static int nMissedOverlayPaints = 0; static int nMissedOverlayPaints = 0;
const bool bSurfaceWantsAsync = g_HeldCommits[HELD_COMMIT_BASE] && g_HeldCommits[HELD_COMMIT_BASE]->async;
const bool bForceSyncFlip = g_bTakeScreenshot || is_fading_out(); const bool bForceSyncFlip = g_bTakeScreenshot || is_fading_out();
// If we are compositing, always force sync flips because we currently wait // If we are compositing, always force sync flips because we currently wait
// for composition to finish before submitting. // for composition to finish before submitting.
// If we want to do async + composite, we should set up syncfile stuff and have DRM wait on it. // If we want to do async + composite, we should set up syncfile stuff and have DRM wait on it.
const bool bNeedsSyncFlip = bForceSyncFlip || g_bCurrentlyCompositing || nMissedOverlayPaints; const bool bNeedsSyncFlip = bForceSyncFlip || g_bCurrentlyCompositing || nMissedOverlayPaints;
const bool bDoAsyncFlip = g_bAsyncFlipsEnabled && g_bSupportsAsyncFlips && !bNeedsSyncFlip; const bool bDoAsyncFlip = g_bAsyncFlipsEnabled && g_bSupportsAsyncFlips && bSurfaceWantsAsync && !bNeedsSyncFlip;
bool bShouldPaint = false; bool bShouldPaint = false;
if ( bDoAsyncFlip ) if ( bDoAsyncFlip )