@@ -217,9 +217,9 @@ pub struct GpuLights {
217
217
// NOTE: this must be kept in sync with the same constants in pbr.frag
218
218
pub const MAX_UNIFORM_BUFFER_POINT_LIGHTS : usize = 256 ;
219
219
pub const MAX_DIRECTIONAL_LIGHTS : usize = 10 ;
220
- #[ cfg( not( feature = "webgl" ) ) ]
220
+ #[ cfg( any ( not( feature = "webgl" ) , not ( target_arch = "wasm32" ) ) ) ]
221
221
pub const MAX_CASCADES_PER_LIGHT : usize = 4 ;
222
- #[ cfg( feature = "webgl" ) ]
222
+ #[ cfg( all ( feature = "webgl" , target_arch = "wasm32" ) ) ]
223
223
pub const MAX_CASCADES_PER_LIGHT : usize = 1 ;
224
224
pub const SHADOW_FORMAT : TextureFormat = TextureFormat :: Depth32Float ;
225
225
@@ -683,13 +683,13 @@ pub fn prepare_lights(
683
683
let mut point_lights: Vec < _ > = point_lights. iter ( ) . collect :: < Vec < _ > > ( ) ;
684
684
let mut directional_lights: Vec < _ > = directional_lights. iter ( ) . collect :: < Vec < _ > > ( ) ;
685
685
686
- #[ cfg( not( feature = "webgl" ) ) ]
686
+ #[ cfg( any ( not( feature = "webgl" ) , not ( target_arch = "wasm32" ) ) ) ]
687
687
let max_texture_array_layers = render_device. limits ( ) . max_texture_array_layers as usize ;
688
- #[ cfg( not( feature = "webgl" ) ) ]
688
+ #[ cfg( any ( not( feature = "webgl" ) , not ( target_arch = "wasm32" ) ) ) ]
689
689
let max_texture_cubes = max_texture_array_layers / 6 ;
690
- #[ cfg( feature = "webgl" ) ]
690
+ #[ cfg( all ( feature = "webgl" , target_arch = "wasm32" ) ) ]
691
691
let max_texture_array_layers = 1 ;
692
- #[ cfg( feature = "webgl" ) ]
692
+ #[ cfg( all ( feature = "webgl" , target_arch = "wasm32" ) ) ]
693
693
let max_texture_cubes = 1 ;
694
694
695
695
if !* max_directional_lights_warning_emitted && directional_lights. len ( ) > MAX_DIRECTIONAL_LIGHTS
@@ -1162,9 +1162,9 @@ pub fn prepare_lights(
1162
1162
. create_view ( & TextureViewDescriptor {
1163
1163
label : Some ( "point_light_shadow_map_array_texture_view" ) ,
1164
1164
format : None ,
1165
- #[ cfg( not( feature = "webgl" ) ) ]
1165
+ #[ cfg( any ( not( feature = "webgl" ) , not ( target_arch = "wasm32" ) ) ) ]
1166
1166
dimension : Some ( TextureViewDimension :: CubeArray ) ,
1167
- #[ cfg( feature = "webgl" ) ]
1167
+ #[ cfg( all ( feature = "webgl" , target_arch = "wasm32" ) ) ]
1168
1168
dimension : Some ( TextureViewDimension :: Cube ) ,
1169
1169
aspect : TextureAspect :: All ,
1170
1170
base_mip_level : 0 ,
@@ -1177,9 +1177,9 @@ pub fn prepare_lights(
1177
1177
. create_view ( & TextureViewDescriptor {
1178
1178
label : Some ( "directional_light_shadow_map_array_texture_view" ) ,
1179
1179
format : None ,
1180
- #[ cfg( not( feature = "webgl" ) ) ]
1180
+ #[ cfg( any ( not( feature = "webgl" ) , not ( target_arch = "wasm32" ) ) ) ]
1181
1181
dimension : Some ( TextureViewDimension :: D2Array ) ,
1182
- #[ cfg( feature = "webgl" ) ]
1182
+ #[ cfg( all ( feature = "webgl" , target_arch = "wasm32" ) ) ]
1183
1183
dimension : Some ( TextureViewDimension :: D2 ) ,
1184
1184
aspect : TextureAspect :: All ,
1185
1185
base_mip_level : 0 ,
0 commit comments