Re:Bevy 0.10: data oriented game engine built in Rust
by SleepyMyroslav on Monday March 06, 2023 @03:09PM
(#35046881)
two questions:
How big is the part of the engine that uses 'unsafe' Rust?
What systems are to be multithreaded on release? Like Rendering, Physics etc.
[ Parent
| on HN ]
Re:Bevy 0.10: data oriented game engine built in Rust
by _cart on Monday March 06, 2023 @03:18PM
(#35046994)
Bevy ECS has a good chunk of `unsafe` as we're doing granular parallel data access that the Rust compiler cannot reason about. Anything related to low-level system api bindings (Vulkan, audio, etc) is inherently unsafe. But basically all "engine logic" (like our actual renderer logic, scenes, assets, etc) is written in safe Rust. We only use unsafe if we _absolutely need to_ and give it a lot of scrutiny. Impossible to avoid it entirely in the engine space though!
The engine is very threaded in general. We do pipelined rendering so the next frame's logic is computed while the current frame is rendering, we multithread expensive potentially high-entity tasks like animation and transform propagation, all ECS systems run in parallel (which includes the renderer systems), etc. We'll use whatever cores you give us!