Skip to content

Commit

Permalink
Fixes bug where shader crashes on Adreno GPUs, when running in WebGL …
Browse files Browse the repository at this point in the history
…mode on browsers
  • Loading branch information
TotalKrill committed Apr 28, 2023
1 parent 670f3f0 commit 77ce205
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_pbr/src/render/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +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;

#[cfg(feature = "webgl")] //NOTE: This fixes shader chrash with running Adreno GPU chipsets
pub const MAX_DIRECTIONAL_LIGHTS: usize = 1;
#[cfg(not(feature = "webgl"))]
pub const MAX_DIRECTIONAL_LIGHTS: usize = 10;

#[cfg(not(feature = "webgl"))]
pub const MAX_CASCADES_PER_LIGHT: usize = 4;
#[cfg(feature = "webgl")]
Expand Down

0 comments on commit 77ce205

Please sign in to comment.