Skip to content

Only re-allocate modified meshes with differing sizes/layouts#24326

Draft
Aceeri wants to merge 2 commits into
bevyengine:mainfrom
Aceeri:mesh-allocator-reuse-same-size
Draft

Only re-allocate modified meshes with differing sizes/layouts#24326
Aceeri wants to merge 2 commits into
bevyengine:mainfrom
Aceeri:mesh-allocator-reuse-same-size

Conversation

@Aceeri
Copy link
Copy Markdown
Member

@Aceeri Aceeri commented May 17, 2026

Objective

There isn't currently a way to not re-allocate meshes/re-use meshes that you want to update. In my case a solid 40-90% of my runtime ends up dominated by allocate_and_free_meshes as I'm modifying terrain/voxel meshes often.

Solution

Only free & allocate if the attribute size/layout differs from the previous upload. With this you can create statically sized meshes that you can modify/reuse :)

Testing

TBD


Showcase

@Aceeri Aceeri force-pushed the mesh-allocator-reuse-same-size branch from 0251c3b to be3afdc Compare May 17, 2026 09:16
@Aceeri Aceeri added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times labels May 17, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 17, 2026
@Aceeri Aceeri added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

1 participant