Editor viewport is being rendered in PIE

Hello,

we have observed that a editor viewport is still being rendered in PIE even when it doesn’t have focus. It can destroy GPU and render thread performance. However, this happens only after an interaction with the editor viewport. When I don’t click into it and start PIE right away, FEditorModeTools::ReceivedFocus() is not called and the editor viewport won’t be rendered. The UEditorInteractiveToolsContext::Tick() won’t invalidate it each frame because FEditorModeTools::FocusedViewportClient is not set - it won’t set bNeedsRedraw on the viewport.

There is a comment in FEditorModeTools::LostFocus() that it intentionally doesn’t clear it.

It issue can be mitigated by unloading whole world partition since the editor viewport will be faster to render. But it doesn’t seem like practical solution. In dense level it cuts our PIE fps in half.

I will show an example on GPU since it is better visible there than on render thread.

No interaction with the editor viewport:

[Image Removed]

With unloaded world partition:

[Image Removed]

Loaded part of world partition:

[Image Removed]

Thanks,

Jiri

Steps to Reproduce
Repro is very simple:

  1. Open a level
  2. Click into the editor viewport
  3. Enter PIE
  4. Check GPU and render thread performance in Unreal Insights

Hi there,

I have so far been unable to replicate this. By PIE, I assume you mean New Editor Window PIE, which launches PIE in a separate window. With this assumption, I tried doing your reproduction steps using the first person shooter template in 5.7 (both launcher and source build), but was unable to replicate. What I could do was click back into, and interact with, the editor viewport and get similar behavior to what you are seeing (with two scene renderers active). However, stopping interaction with the editor viewport (not moving the camera), or clicking back into the PIE window (and therefore defocusing the editor viewport) dropped the active scene renderers back to 1 per frame in insights.

Could you provide a small reproduction project for this. Once I can replicate I can start debugging this issue and potentially file a bug report.

Regards,

Lance Chaney

Hi Lance,

you are right, sorry for the confusion. I tested it wasn’t able to reproduce now on newest 5.7.

I am able to reproduce it easily on 5.8 (but I can’t specify 5.8 as a version) on clean //UE5/Main stream with just Blank project template on the initial Open World level. I just entered game mode there few times.

By PIE I meant the default game mode in “Selected Viewport” but I observe the same behavior in “New Editor Viewport (PIE)” too.

I have tried it on //UE5/Main using CL 48747459. We are observing this behavior for several weeks but I haven’t found a changelist which could cause it.

Regards,

Jiri

Ah, thanks, I am able to replicate this now and have opened a bug report for this. The public bug tracker should be available here once it has been triaged by epic.

Regards,

Lance Chaney

We’re experiencing the same issue in 5.7.1 (synced to CL 48589540 of //UE5/Release-5.7).

Btw actual link to issue here.

Thanks for the info, we’ll update the bug report.

Sam