We have a scene in a pocket world with a mesh lit by a number of point and spot lights being rendered by a ASceneCapturePocketLevelActor. We are seeing an issue where all lights in the scene capture flicker off intermittently for a frame. From debugging, I can see that the lights are not being culled or excluded from rendering by the engine. InternalRenderLight is calling StencilingGeometry::DrawSphere(RHICmdList) for the correct number of lights every frame.
The flickering stops when the RHI thread is disabled (r.RHIThread.Enable 0).
The flickering also stops when I set r.GTSyncType 0. We usually have r.GTSyncType 1 to reduce lag.
The flickering still happens with:
r.RDG.ImmediateMode 1
r.rdg.debug.flushgpu 1
r.rdg.debug.extendresourcelifetimes 1
r.rdg.debug.disabletransientresources 1
r.rhi.cmdbypass 1
Vsync on or off
Only a single light in the pocket world
So I am guessing that there is a synchronisation issue between the RHI thread and the game or render thread that is causing the draw calls for the lights to get corrupted. I have tried to eliminate any dependency that the data used by the draw call might have with data that could be modified by the game or render thread, without success. I am running out of ideas for how to debug this further, so any suggestions would be appreciated.
[Attachment Removed]