-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Pipelined Rendering: Deferred Extraction Commands #5082
Description
What problem does this solve or what need does it fill?
Running commands can get expensive. They require significant amounts of time relative to just normal system query iteration and require exclusive access to the World they're being run on. Extract in particular currently has an exclusive hold on both main and render worlds and takes significant amounts of time in large or complex scenes.
What solution would you like?
When pipelined rendering is enabled, instead of holding an exclusive lock on both worlds. Run read-only over the main world, and send the commands to the render world, deferring command application to run in parallel with the next game tick's game update.
A benefit of this approach is that there is no explicit synchronization point here other than the start of the frame. The only downside is that we need a secondary storage to drain all CommandQueues into a single one to send to the Render World. This last part can be exceptionally fast as it's essentially a single memcpy per system.
What alternative(s) have you considered?
Explicit synchronization point between main and render worlds.
