Bevy: Now that we have Changed<T>, optimize all the things

Created on 20 Jul 2020  路  3Comments  路  Source: bevyengine/bevy

We should be using Changed<T> everywhere we can to avoid doing redundant work:

  • Transforms
  • Parents/Children
  • Labels
  • Render Nodes

    • lights

    • camera

    • render_resources (potentially a _huge_ win here)

  • Cameras
  • ShaderDefs
  • Sprites
  • UI update system (only update "dirty" parts of the tree)
  • Pipeline Compiler (only run when RenderPipelines component has changed)
good first issue performance

Most helpful comment

@cart it may be worth changing your list into checkboxes so we can track status

All 3 comments

I was looking into doing this for the transforms systems. For transform_translation_rotation_scale_system, the current query is:

Query<Without<LocalTransform, Without<NonUniformScale, (&mut Transform, &Translation, &Rotation, &Scale)>>>

ideally we could do something like

Query<Without<LocalTransform, Without<NonUniformScale, (&mut Transform, &Translation, &Rotation, &Scale, Any<Changed<Translation>, Changed<Rotation>, Changed<Scale>>)>>>

the idea being we want to run this system on anything that has Transform, Rotation and Scale, and at least one of those was changed.

I asked in Discord and it seems like this is not currently possible (tldr queries are and only, no or right now)

@cart it may be worth changing your list into checkboxes so we can track status

What's left for this task?

Was this page helpful?
0 / 5 - 0 ratings