Skip to content

Commit

Permalink
Fixes bug where shader crashes on Adreno GPUs using WebGL
Browse files Browse the repository at this point in the history
  • Loading branch information
TotalKrill committed Apr 28, 2023
1 parent 670f3f0 commit 2073132
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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,14 @@ 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(feature = "webgl")]
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 2073132

Please sign in to comment.