bevy/crates
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
..
bevy_a11y Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_animation Remove ClampColor (#13307) 2024-05-10 13:15:56 +00:00
bevy_app Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_asset Misc asset code quality and docs (#13382) 2024-05-15 18:49:04 +00:00
bevy_audio Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_color Implement Color Operations for Color (#13285) 2024-05-14 10:15:47 +00:00
bevy_core Determine msrv for every standalone bevy_* crate. (#13211) 2024-05-13 18:26:41 +00:00
bevy_core_pipeline Enable depth of field on webgpu (#13374) 2024-05-16 06:48:28 +00:00
bevy_derive Update compile test to use ui_test 0.23 (#13245) 2024-05-05 22:17:56 +00:00
bevy_dev_tools #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
bevy_diagnostic Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dylib Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dynamic_plugin Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ecs Implement WorldQuery and QueryData on Mut. (#13338) 2024-05-14 12:38:31 +00:00
bevy_encase_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gilrs Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gizmos #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
bevy_gltf Add UV channel selection to StandardMaterial (#13200) 2024-05-13 18:23:09 +00:00
bevy_hierarchy Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_input Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_internal Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_log Improve tracing layer customization (#13159) 2024-05-12 21:16:56 +00:00
bevy_macro_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_math Allow shapes to be constructed with zero values (#13365) 2024-05-16 02:22:50 +00:00
bevy_mikktspace Determine msrv for every standalone bevy_* crate. (#13211) 2024-05-13 18:26:41 +00:00
bevy_pbr #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
bevy_ptr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect Determine msrv for every standalone bevy_* crate. (#13211) 2024-05-13 18:26:41 +00:00
bevy_render #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
bevy_scene Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_sprite Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_state State example (#13322) 2024-05-13 13:03:42 +00:00
bevy_tasks multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
bevy_text Add doc comments explaining the different behaviours of alignment and Anchor with text_2d (#8022) 2024-05-12 21:42:04 +00:00
bevy_time Make bevy_time optionally depend on bevy_reflect (#13263) 2024-05-12 23:19:07 +00:00
bevy_transform Use Dir3 for local axis methods in GlobalTransform (#13264) 2024-05-06 20:52:05 +00:00
bevy_ui Fix UI border artifacts caused by incorrect blending (#12725) 2024-05-15 18:50:30 +00:00
bevy_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_window Ensure clean exit (#13236) 2024-05-12 15:56:01 +00:00
bevy_winit Ensure clean exit (#13236) 2024-05-12 15:56:01 +00:00