steamcompmgr: Disable tearing if Mangoapp, etc is up (hack)

Avoids bad stutter for now.
This commit is contained in:
Joshua Ashton 2023-03-02 16:32:23 +00:00
parent 140df9a81d
commit 06586a6d12

View file

@ -6483,6 +6483,12 @@ steamcompmgr_main(int argc, char **argv)
const bool bVRR = drm_get_vrr_in_use( &g_DRM );
// HACK: Disable tearing if we have an overlay to avoid stutters right now
// TODO: Fix properly.
static bool bHasOverlay = ( global_focus.overlayWindow && global_focus.overlayWindow->opacity ) ||
( global_focus.externalOverlayWindow && global_focus.externalOverlayWindow->opacity ) ||
( global_focus.overrideWindow && global_focus.focusWindow && !global_focus.focusWindow->isSteamStreamingClient && global_focus.overrideWindow->opacity );
const bool bSteamOverlayOpen = global_focus.overlayWindow && global_focus.overlayWindow->opacity;
// If we are running behind, allow tearing.
const bool bSurfaceWantsAsync = (g_HeldCommits[HELD_COMMIT_BASE] && g_HeldCommits[HELD_COMMIT_BASE]->async);
@ -6493,7 +6499,7 @@ steamcompmgr_main(int argc, char **argv)
// 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.
const bool bNeedsSyncFlip = bForceSyncFlip || g_bCurrentlyCompositing || nIgnoredOverlayRepaints;
const bool bDoAsyncFlip = ( ((g_nAsyncFlipsEnabled >= 1) && g_bSupportsAsyncFlips && bSurfaceWantsAsync) || bVRR ) && !bSteamOverlayOpen && !bNeedsSyncFlip;
const bool bDoAsyncFlip = ( ((g_nAsyncFlipsEnabled >= 1) && g_bSupportsAsyncFlips && bSurfaceWantsAsync && !bHasOverlay) || bVRR ) && !bSteamOverlayOpen && !bNeedsSyncFlip;
bool bShouldPaint = false;
if ( bDoAsyncFlip )