From e2faedb99ce78c39d4f76fb852345b3ab0bc16a6 Mon Sep 17 00:00:00 2001 From: akimakinai <105044389+akimakinai@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:26:53 +0900 Subject: [PATCH] Add missing limit by `max_texture_cubes` --- crates/bevy_pbr/src/render/light.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index c59ffe1ee3852..9cc3fec765e68 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -735,7 +735,8 @@ pub fn prepare_lights( let point_light_count = point_lights .iter() .filter(|light| light.1.spot_light_angles.is_none()) - .count(); + .count() + .min(max_texture_cubes); let point_light_volumetric_enabled_count = point_lights .iter()