diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index 23e866422d709..00beb05b5e91f 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -216,6 +216,12 @@ pub struct GpuLights { // NOTE: this must be kept in sync with the same constants in pbr.frag pub const MAX_UNIFORM_BUFFER_POINT_LIGHTS: usize = 256; + +//NOTE: When running bevy on Adreno GPU chipsets in WebGL, any value above 1 will result in a crash +// when loading the wgsl "pbr_functions.wgsl" in the function apply_fog. +#[cfg(all(feature = "webgl", target_arch = "wasm32"))] +pub const MAX_DIRECTIONAL_LIGHTS: usize = 1; +#[cfg(any(not(feature = "webgl"), not(target_arch = "wasm32")))] pub const MAX_DIRECTIONAL_LIGHTS: usize = 10; #[cfg(any(not(feature = "webgl"), not(target_arch = "wasm32")))] pub const MAX_CASCADES_PER_LIGHT: usize = 4;