Back to Bevy

RenderMeshInstance becomes atomic

release-content/migration-guides/atomic_render_mesh_instance.md

0.18.1596 B
Original Source

In order to enhance the performance and scalability of RenderMeshInstance, its fields have been made atomic. Code that accessed fields like:

rust
let instance: &RenderMeshInstance = ...;
... instance.mesh_asset_id ...

Should now use the accessor methods like this:

rust
let instance: &RenderMeshInstance = ...;
... instance.mesh_asset_id() ...

There are associated setter methods with a set_ prefix as well. Note that, because RenderMeshInstance fields are atomic, you don't need an &mut reference to call them. However, it's now your responsibility to avoid data races.