Skip to content

Add many_meshlet_materials stress test example#23792

Open
CrazyRoka wants to merge 1 commit intobevyengine:mainfrom
CrazyRoka:many-meshlet-materials
Open

Add many_meshlet_materials stress test example#23792
CrazyRoka wants to merge 1 commit intobevyengine:mainfrom
CrazyRoka:many-meshlet-materials

Conversation

@CrazyRoka
Copy link
Copy Markdown
Contributor

Objective

  • Introduce a dedicated example to measure performance overhead when dealing with a high number of meshlet instances and unique materials.

Solution

  • Added a new example many_meshlet_materials that spawns a configurable grid of meshlet bunnies.

Testing

  • SystemInfo { os: "Linux (CachyOS Linux rolling)", kernel: "6.19.10-1-cachyos", cpu: "AMD Ryzen 7 5800H with Radeon Graphics", core_count: "8", memory: "15.0 GiB" }
  • AdapterInfo { name: "AMD Radeon Graphics (RADV RENOIR)", vendor: 4098, device: 5688, device_type: IntegratedGpu, device_pci_bus_id: "0000:03:00.0", driver: "radv", driver_info: "Mesa 26.0.3-arch2.2", backend: Vulkan, subgroup_min_size: 64, subgroup_max_size: 64, transient_saves_memory: false }
  • cargo run --features=meshlet,https --release --example many_meshlet_materials

Showcase

Example works perfectly with 5x5 grid.

image

The issue begins when grid count increases to 10x10. Meshes start flickering.

image

With 50x50 meshes, the whole screen flickers.

image

When running with unique materials, performance significantly drops on my hardware.

image

@CrazyRoka CrazyRoka force-pushed the many-meshlet-materials branch from 374b55a to 9e380cd Compare April 13, 2026 20:25
@CrazyRoka CrazyRoka force-pushed the many-meshlet-materials branch from 9e380cd to 39bbc4d Compare April 13, 2026 20:29
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Benchmarks Stress tests and benchmarks used to measure how fast things are X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 13, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Apr 13, 2026
@JMS55 JMS55 self-requested a review April 14, 2026 02:04
@JMS55
Copy link
Copy Markdown
Contributor

JMS55 commented Apr 14, 2026

The flickering seems like a regression - I've tested with a much greater number of instances before.

Assuming it's not CPU bound, there's a lot of simple things we can do to improve the perf of many materials. Currently we spawn a full screen triangle for every single material, which is super inefficient. We should be spawning a quad covering only the needed pixels per material. I just haven't gotten around to it.

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-Benchmarks Stress tests and benchmarks used to measure how fast things are D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants