I’m dispatching compute shaders on an Actor tick to the render thread with ENQUEUE_RENDER_COMMAND then I read back the data when it is ready. I want to read it back on the next frame. However, the render thread runs a frame (or more) behind the main thread, and it can be several frames before the results are ready. I’m computing a realtime simulation in the compute shader, so this is not ideal.
Is there a way to dispatch compute shaders on a queue separate from the render thread? How can I dispatch compute shaders on frame n so the results are ready on frame n +1?