Nilirad / bevy_prototype_lyon

Draw 2D shapes in Bevy
Apache License 2.0
702 stars 87 forks source link

Batch draw calls? #159

Open SUPERCILEX opened 2 years ago

SUPERCILEX commented 2 years ago

See https://github.com/bevyengine/bevy/issues/3763#issuecomment-1025022526. I'm not sure if this is actually an issue.

louiidev commented 2 years ago

Performance seems like an issue for this crate currently, I'm drawing the same thing multiple times and notice a big dip in fps, batching should help a lot

rparrett commented 1 year ago

With Bevy 0.12 getting automatic batching, it might be possible to rework bevy_prototype_lyon so that it can benefit from that. As things stand now, this doesn't help us.

We would need to find some way to reuse generated mesh assets so that shape entities with the same attributes would point at the same mesh asset. I'm guessing that this is more complicated than it sounds -- we need to make sure Bevy's asset lifecycle continues to work. i.e. assets that are no longer referenced in the world get dropped.

seivan commented 5 months ago

Is this fixed? Since Bevy should now group material and meshes together?

rparrett commented 5 months ago

As far as I know, no. Last time I looked, Bevy only batches when the mesh handle is identical and unless I missed something, that hasn't changed. My previous message should still generally be true

seivan commented 5 months ago

As far as I know, no. Last time I looked, Bevy only batches when the mesh handle is identical and unless I missed something, that hasn't changed. My previous message should still generally be true

That actually makes sense. It should be like that. So if the handle is the same for the mesh and material, it will batch? That’s perfect.