EditorSelectionOutlines Uses Massive GPU in VR

I’m working on a VR project, and I’ve run into an issue with performance. Any time I try to playtest the level I’m working on, the PostProcessing pass tanks the frame rate. Digging into the visualizer, I found that nearly 40 ms are being dedicated to “EditorSelectionOutlines” and “CompositeEditorPrimitives”.

I’m using an Oculus Quest 2 with Rift link enabled to run tests. My computer has an RTX 2080 super graphics card.

Why is this happening and how do I fix it?

One of our artists just noticed this today in UE4.25.3. In his case he was noticing bad editor performance AFTER doing a VR-PIE. Perf got really bad opening up a static mesh preview window. We did the GPU snapshot first (see attached GPU snapshot) and found the same two hotspots with “EditorSelectionOutlines” and “CompositeEditorPrimitives”.

We found we could work around the slowdown by turning off those two rendering stages with show flag toggles (see attached).

We tried to dig into the bad perf in the editor with RenderDoc but sadly kept running into editor crashes (lost GPU device) when trying to initiate a capture :(.

Finally we did a sampling capture of the editor using stat startfile/stopfile. I noticed we were seeing a stall on a RenderQuery result (see attached). We’ve seen this before with other VR perf issues with PIE. I’ve only looked into it a bit, but it appears that the RenderQueries are the timers UE4 uses to see how long draw calls are taking. In some circumstances they stall for a surprising amount of time (12ms in this instance!). We’ve worked around this in the past by adding a console/config var that let’s us set the Engine’s GSupportsTimestampRenderQueries to false. That appears to turn off the fetching of the GPU timers, bypassing the stall, at the cost of no longer being able to profile your GPU calls (so you want to be able to toggle that as needed). Finally I should mention this might be unrelated parallel problem. We’re still investigating.

Sigh. Looks like 3 of my attachments didn’t get posted for some reason. I’ll just post the flags here as text:

→ Show > Developer > Composite Editor Primitives

→ Hit ~ to bring up the console in the editor and type: showflag.SelectionOutline 0

Restarting the computer - not the editor, not oculus, neither of those worked - solved the problem, but only for about 4-5 hours, after which it returned. I’ll try your solution tomorrow and see what happens.

Still haven’t figured out the original problem, but just wanted to say your solution has worked so far. Another issue that has popped up is that the Prepass will increase from 0.2 ms to 10 ms. Still not sure what the cause is, but it happens at the same time as other performance issues. Still, it’s not effect performance nearly as much as the other issues. We’re going to test out some builds of the project and see if we still run into issues outside the editor, as well as hopefully testing it installed on the quest (ie, without the link).