@@ -19,7 +19,8 @@ use bevy_window::Windows;
19
19
20
20
use crate :: {
21
21
calculate_cluster_factors, CubeMapFace , CubemapVisibleEntities , ViewClusterBindings ,
22
- CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT , CUBE_MAP_FACES , MAX_POINT_LIGHTS , POINT_LIGHT_NEAR_Z ,
22
+ CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT , CUBE_MAP_FACES , MAX_UNIFORM_BUFFER_POINT_LIGHTS ,
23
+ POINT_LIGHT_NEAR_Z ,
23
24
} ;
24
25
25
26
/// A light that emits light in all directions from a central point.
@@ -736,7 +737,7 @@ pub(crate) fn assign_lights_to_clusters(
736
737
clustered_forward_buffer_binding_type,
737
738
BufferBindingType :: Storage { .. }
738
739
) ;
739
- if lights. len ( ) > MAX_POINT_LIGHTS && !supports_storage_buffers {
740
+ if lights. len ( ) > MAX_UNIFORM_BUFFER_POINT_LIGHTS && !supports_storage_buffers {
740
741
lights. sort_by ( |light_1, light_2| {
741
742
point_light_order (
742
743
( & light_1. entity , & light_1. shadows_enabled ) ,
@@ -752,7 +753,7 @@ pub(crate) fn assign_lights_to_clusters(
752
753
let mut lights_in_view_count = 0 ;
753
754
lights. retain ( |light| {
754
755
// take one extra light to check if we should emit the warning
755
- if lights_in_view_count == MAX_POINT_LIGHTS + 1 {
756
+ if lights_in_view_count == MAX_UNIFORM_BUFFER_POINT_LIGHTS + 1 {
756
757
false
757
758
} else {
758
759
let light_sphere = Sphere {
@@ -772,12 +773,15 @@ pub(crate) fn assign_lights_to_clusters(
772
773
}
773
774
} ) ;
774
775
775
- if lights. len ( ) > MAX_POINT_LIGHTS && !* max_point_lights_warning_emitted {
776
- warn ! ( "MAX_POINT_LIGHTS ({}) exceeded" , MAX_POINT_LIGHTS ) ;
776
+ if lights. len ( ) > MAX_UNIFORM_BUFFER_POINT_LIGHTS && !* max_point_lights_warning_emitted {
777
+ warn ! (
778
+ "MAX_UNIFORM_BUFFER_POINT_LIGHTS ({}) exceeded" ,
779
+ MAX_UNIFORM_BUFFER_POINT_LIGHTS
780
+ ) ;
777
781
* max_point_lights_warning_emitted = true ;
778
782
}
779
783
780
- lights. truncate ( MAX_POINT_LIGHTS ) ;
784
+ lights. truncate ( MAX_UNIFORM_BUFFER_POINT_LIGHTS ) ;
781
785
}
782
786
783
787
for ( view_entity, camera_transform, camera, frustum, config, clusters, mut visible_lights) in
0 commit comments