UE-71894 causing stalls during GPU data readback

Hello,
In 4.22 issue UE-71894 Crash opening TM-ShaderModels with Intel’s RHI Thread changes: D3D device being lost. was fixed but after this fix big GPU stalls appeared during GPU readback used in Niagara particles plugin.

I found commit with this fix [here][1] and it seems inappropriate.

The reason is that it causes command buffer flush on every lock. But in case we want to read data back and can guarantee that data is ready from algorithm then we don’t need this flush. Even more it causes flushing unnecessary commands and long GPU stalls up to 15ms.

As proof that this flush and stall should not exist is comment on RHIGPUReadback.h

/*============================================================================= RHIGPUReadback.h: classes for managing fences and staging buffers for asynchronous GPU memory updates and readbacks with minimal stalls and no RHI thread flushes =============================================================================*/

I don’t have access to jira and issue discussion but it seems that fix brokes perfomance.