Commit 50d38f2
authored
Fix point light count limit (bevyengine#16062)
# Objective
- I made a mistake in bevyengine#15902, specifically [this
diff](bevyengine@e2faedb)
-- the `point_light_count` variable is used for all point lights, not
just shadow mapped ones, so I cannot add `.min(max_texture_cubes)`
there. (Despite `spot_light_count` having `.min(..)`)
It may have broken code like this (where `index` is index of
`point_light` vec):
https://github.com/bevyengine/bevy/blob/9930df83ed42008f7eb2c02cc7350040f0250c2e/crates/bevy_pbr/src/render/light.rs#L848-L850
and also causes panic here:
https://github.com/bevyengine/bevy/blob/9930df83ed42008f7eb2c02cc7350040f0250c2e/crates/bevy_pbr/src/render/light.rs#L1173-L1174
## Solution
- Adds `.min(max_texture_cubes)` directly to the loop where texture
views for point lights are created.
## Testing
- `lighting` example (with the directional light removed; original
example doesn't crash as only 1 directional-or-spot light in total is
shadow-mapped on webgl) no longer crashes on webgl1 parent 2223f6e commit 50d38f2
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
753 | | - | |
| 752 | + | |
754 | 753 | | |
755 | 754 | | |
756 | 755 | | |
| |||
1060 | 1059 | | |
1061 | 1060 | | |
1062 | 1061 | | |
1063 | | - | |
| 1062 | + | |
1064 | 1063 | | |
1065 | 1064 | | |
1066 | 1065 | | |
| |||
0 commit comments