Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor
logan buchy afc26a0f51 Prevent LevelEditorViewportClient draw on PIE in LevelEditorViewport
* This change addesses an issue which causes the LevelEditorViewportClient to render while PIE is active on the LevelEditorViewport. This results in a frame which is never displayed and therefore reduced rendering performance.
* The issue's root cuase is due to behaviour where the GameViewportClient and EditorViewportClient swap their stat flags when PIE is started on a selected LevelEditor sceneviewport - see FSceneViewport::SwapStatCommands.  When stat flags are present on the GameViewportClient before PIE is started, the EditorViewportClient will inherit the stat flags.  However, this has the side-effect of pushing a 'true' RealTime override onto ViewportClient.  This causes ViewportClient->IsRealtime() to return true.
* UEditorEngine::UpdateSingleViewportClient() is called by the UEditorEngine::Tick() each frame,  finds the EditorViewportClient->IsRealtime() to be true and triggers LevelEditorViewportClient->Viewport->Draw() even though there is no SceneViewport to display the render.
* The fix pushes a realtime override to disable realtime mode for the LevelEditorViewportClient when a PIE session is started that takes over the LevelEditorViewport and subsequently removes the override when PIE ends.

#jira UE-168061
#rb ronald.koppers

[CL 26621251 by logan buchy in ue5-main branch]
2023-07-26 16:56:32 -04:00
..