Is there any way to get asynchronous access to RenderTargets? ReadPixels unfortunately checks whether it is being called from the GameThread and if not, fails. Is there a way to block RenderTargets so async access would be safe?
ReadPixels fails off the game thread because it flushes the rhi command list and waits on the gpu, so from another thread youd either deadlock or read garbage. theres no thread safe version of that exact call, which is why the engine asserts on it.
the non blocking route is the async readback api, queue a copy on the render thread and poll it with a fence over the next frames, so the game thread never blocks on the gpu.
if you dont want to juggle the fences yourself, Async Render Target Reader, a render target readback plugin for Unreal Engine 5, wraps it as a Read Render Target Pixels Async node with On Success and On Failure: Async Render Target Reader — Non-Blocking GPU Pixel Readback for Blueprints | Fab