Try instance-rate vertex buffer for per-instance data for CPU-driven rendering
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Objective
Improve performance of 2D/3D mesh rendering.
## Solutions
I observed a significant performance boost to sprite rendering when moving to using an instance-rate vertex buffer for per-instance data, compared to using a uniform or storage buffer, such as via `GpuArrayBuffer`.
Because of the constraints on CPU-driven rendering and not being able to feasibly implement meshlet-based rendering on the CPU to be able to batch draws across different meshes, there is no need to be able to randomly access per-instance data, and we anyway write it in draw order.
As such, it seems reasonable to try out using an instance-rate vertex buffer for per-instance data to see if it brings a performance benefit to 2D/3D mesh rendering.
Contributor guide
Research direction
Start by tracing CPU-driven rendering and the existing per-instance data path, including uses of GpuArrayBuffer, then compare it with the sprite-rendering path described in the issue. The work is done when instance-rate vertex-buffer data is implemented for the relevant 2D/3D mesh rendering path and measurements show whether it improves performance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100