Skip to content

Pipelined Rendering: Deferred Extraction Commands #5082

@james7132

Description

@james7132

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.

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-PerformanceA change motivated by improving speed, memory usage or compile times

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions