Skip to content

Commit 77ce205

Browse files
committed
Fixes bug where shader crashes on Adreno GPUs, when running in WebGL mode on browsers
1 parent 670f3f0 commit 77ce205

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/bevy_pbr/src/render/light.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ pub struct GpuLights {
216216

217217
// NOTE: this must be kept in sync with the same constants in pbr.frag
218218
pub const MAX_UNIFORM_BUFFER_POINT_LIGHTS: usize = 256;
219+
220+
#[cfg(feature = "webgl")] //NOTE: This fixes shader chrash with running Adreno GPU chipsets
221+
pub const MAX_DIRECTIONAL_LIGHTS: usize = 1;
222+
#[cfg(not(feature = "webgl"))]
219223
pub const MAX_DIRECTIONAL_LIGHTS: usize = 10;
224+
220225
#[cfg(not(feature = "webgl"))]
221226
pub const MAX_CASCADES_PER_LIGHT: usize = 4;
222227
#[cfg(feature = "webgl")]

0 commit comments

Comments
 (0)