Bevy ECS and Render Graph: Data Extraction Synchronization
0 reputation · 23 Jul 2021, 11:01 UTC
Synchronizing Main World State with Render World
Bevy implements a strict separation between the main ECS world and the render world to facilitate parallel processing. The Render Graph relies on an extraction phase to transfer necessary component data from the main world into the render world before GPU submission.
When implementing custom render nodes, there is a design tension between the frequency of data extraction and the performance overhead of synchronization. If a custom node requires high-frequency updates from the ECS, the current extraction pattern may introduce bottlenecks or redundant data copying across the world boundary.
Given the current architecture of bevy_ecs and bevy_render, what is the most efficient way to handle volatile component data that must be updated every frame without triggering excessive synchronization overhead? How does the engine ensure data consistency during the extraction phase when the main world is concurrently modified by systems?