Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the difference between default render layers and none render layers #14075

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
call out difference between default and none
  • Loading branch information
joseph-gio committed Jun 30, 2024
commit 72ddd1a70079d99ba00d158822e21ca90ad070fc
4 changes: 4 additions & 0 deletions crates/bevy_render/src/view/visibility/render_layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ impl FromIterator<Layer> for RenderLayers {

impl Default for RenderLayers {
/// By default, this structure includes layer `0`, which represents the first layer.
///
/// This is distinct from [`RenderLayers::none`], which doesn't belong to any layers.
fn default() -> Self {
let (_, bit) = Self::layer_info(0);
RenderLayers(SmallVec::from_const([bit]))
Expand All @@ -64,6 +66,8 @@ impl RenderLayers {
}

/// Create a new `RenderLayers` that belongs to no layers.
///
/// This is distinct from [`RenderLayers::default`], which belongs to the first layer.
pub const fn none() -> Self {
RenderLayers(SmallVec::from_const([0]))
}
Expand Down