bevy/crates/bevy_gizmos/src
Patrick Walton f5de3f08fb
Use multidraw for opaque meshes when GPU culling is in use. (#16427)
This commit adds support for *multidraw*, which is a feature that allows
multiple meshes to be drawn in a single drawcall. `wgpu` currently
implements multidraw on Vulkan, so this feature is only enabled there.
Multiple meshes can be drawn at once if they're in the same vertex and
index buffers and are otherwise placed in the same bin. (Thus, for
example, at present the materials and textures must be identical, but
see #16368.) Multidraw is a significant performance improvement during
the draw phase because it reduces the number of rebindings, as well as
the number of drawcalls.

This feature is currently only enabled when GPU culling is used: i.e.
when `GpuCulling` is present on a camera. Therefore, if you run for
example `scene_viewer`, you will not see any performance improvements,
because `scene_viewer` doesn't add the `GpuCulling` component to its
camera.

Additionally, the multidraw feature is only implemented for opaque 3D
meshes and not for shadows or 2D meshes. I plan to make GPU culling the
default and to extend the feature to shadows in the future. Also, in the
future I suspect that polyfilling multidraw on APIs that don't support
it will be fruitful, as even without driver-level support use of
multidraw allows us to avoid expensive `wgpu` rebindings.
2024-12-06 17:22:03 +00:00
..
primitives Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
aabb.rs Reflect derived traits on all components and resources: bevy_gizmos (#15217) 2024-09-15 14:41:49 +00:00
arcs.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
arrows.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
circles.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
config.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
cross.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
curves.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
gizmos.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
grid.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
lib.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
light.rs Implement From translation and rotation for isometries (#15733) 2024-10-08 16:09:28 +00:00
line_joints.wgsl Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
lines.wgsl Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
pipeline_2d.rs Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
pipeline_3d.rs Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
retained.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
rounded_box.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00