bevy/crates/bevy_gizmos/src
charlotte 4c3b7679ec
#12502 Remove limit on RenderLayers. (#13317)
# Objective

Remove the limit of `RenderLayer` by using a growable mask using
`SmallVec`.

Changes adopted from @UkoeHB's initial PR here
https://github.com/bevyengine/bevy/pull/12502 that contained additional
changes related to propagating render layers.

Changes

## Solution

The main thing needed to unblock this is removing `RenderLayers` from
our shader code. This primarily affects `DirectionalLight`. We are now
computing a `skip` field on the CPU that is then used to skip the light
in the shader.

## Testing

Checked a variety of examples and did a quick benchmark on `many_cubes`.
There were some existing problems identified during the development of
the original pr (see:
https://discord.com/channels/691052431525675048/1220477928605749340/1221190112939872347).
This PR shouldn't change any existing behavior besides removing the
layer limit (sans the comment in migration about `all` layers no longer
being possible).

---

## Changelog

Removed the limit on `RenderLayers` by using a growable bitset that only
allocates when layers greater than 64 are used.

## Migration Guide

- `RenderLayers::all()` no longer exists. Entities expecting to be
visible on all layers, e.g. lights, should compute the active layers
that are in use.

---------

Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
2024-05-16 16:15:47 +00:00
..
primitives gizmos: take normal of normal on plane 3d before rotation (#13326) 2024-05-11 19:32:31 +00:00
aabb.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
arcs.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
arrows.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
circles.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
config.rs #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
gizmos.rs Add AXES iterators for Dir types (#13305) 2024-05-09 23:30:44 +00:00
grid.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
lib.rs Add Rounded box gizmos (#11948) 2024-05-16 16:13:49 +00:00
light.rs Add basic light gizmos (#12228) 2024-03-03 18:50:46 +00:00
line_joints.wgsl Gizmo line joints (#12252) 2024-03-11 19:21:32 +00:00
lines.wgsl Gizmo line styles (#12394) 2024-03-25 19:10:45 +00:00
pipeline_2d.rs #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
pipeline_3d.rs #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
rounded_box.rs Add Rounded box gizmos (#11948) 2024-05-16 16:13:49 +00:00