move ShadowsEnabled to material (#19963)

# Objective

- Make bevy_light possible

## Solution

- Move non-light stuff out of light module (its a marker for whether a
material should cast shadows: thats a material property not a light
property)

## Testing

- 3d_scene runs
This commit is contained in:
atlv 2025-07-05 13:05:14 -04:00 committed by GitHub
parent ced36021d0
commit 6ab8e0d9c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -17,7 +17,7 @@ use bevy_render::{
};
use bevy_transform::components::{GlobalTransform, Transform};
use bevy_utils::Parallel;
use core::{marker::PhantomData, ops::DerefMut};
use core::ops::DerefMut;
use crate::*;
pub use light::spot_light::{spot_light_clip_from_view, spot_light_world_from_view};
@ -91,16 +91,6 @@ pub mod light_consts {
}
}
/// Marker resource for whether shadows are enabled for this material type
#[derive(Resource, Debug)]
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
impl<M: Material> Default for ShadowsEnabled<M> {
fn default() -> Self {
Self(PhantomData)
}
}
/// Controls the resolution of [`PointLight`] shadow maps.
///
/// ```

View File

@ -1717,3 +1717,13 @@ pub fn write_material_bind_group_buffers(
allocator.write_buffers(&render_device, &render_queue);
}
}
/// Marker resource for whether shadows are enabled for this material type
#[derive(Resource, Debug)]
pub struct ShadowsEnabled<M: Material>(PhantomData<M>);
impl<M: Material> Default for ShadowsEnabled<M> {
fn default() -> Self {
Self(PhantomData)
}
}