bevy/crates/bevy_pbr/src/prepass
Patrick Walton 3188e5af61
Batch skinned meshes on platforms where storage buffers are available. (#16599)
This commit makes skinned meshes batchable on platforms other than WebGL
2. On supported platforms, it replaces the two uniform buffers used for
joint matrices with a pair of storage buffers containing all matrices
for all skinned meshes packed together. The indices into the buffer are
stored in the mesh uniform and mesh input uniform. The GPU mesh
preprocessing step copies the indices in if that step is enabled.

On the `many_foxes` demo, I observed a frame time decrease from 15.470ms
to 11.935ms. This is the result of reducing the `submit_graph_commands`
time from an average of 5.45ms to 0.489ms, an 11x speedup in that
portion of rendering.

![Screenshot 2024-12-01
192838](https://github.com/user-attachments/assets/7d2db997-8939-466e-8b9e-050d4a6a78ee)

This is what the profile looks like for `many_foxes` after these
changes.

![Screenshot 2024-12-01
193026](https://github.com/user-attachments/assets/68983fc3-01b8-41fd-835e-3d93cb65d0fa)

---------

Co-authored-by: François Mockers <mockersf@gmail.com>
2024-12-10 17:50:03 +00:00
..
mod.rs Batch skinned meshes on platforms where storage buffers are available. (#16599) 2024-12-10 17:50:03 +00:00
prepass.wgsl Batch skinned meshes on platforms where storage buffers are available. (#16599) 2024-12-10 17:50:03 +00:00
prepass_bindings.rs Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
prepass_bindings.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
prepass_io.wgsl Make visibility range (HLOD) dithering work when prepasses are enabled. (#16286) 2024-12-04 17:34:36 +00:00
prepass_utils.wgsl StandardMaterial Light Transmission (#8015) 2023-10-31 20:59:02 +00:00