@@ -378,7 +378,14 @@ fn prepare_bloom_textures(
378378
379379#[ derive( Component ) ]
380380pub struct BloomBindGroups {
381+ #[ cfg( any(
382+ not( feature = "webgl" ) ,
383+ not( target_arch = "wasm32" ) ,
384+ feature = "webgpu"
385+ ) ) ]
381386 cache_key : ( TextureId , BufferId ) ,
387+ #[ cfg( all( feature = "webgl" , target_arch = "wasm32" , not( feature = "webgpu" ) ) ) ]
388+ cache_key : ( Vec < TextureId > , BufferId ) ,
382389 downsampling_bind_groups : Box < [ BindGroup ] > ,
383390 upsampling_bind_groups : Box < [ BindGroup ] > ,
384391 sampler : Sampler ,
@@ -396,12 +403,27 @@ fn prepare_bloom_bind_groups(
396403 let sampler = & downsampling_pipeline. sampler ;
397404
398405 for ( entity, bloom_texture, bloom_bind_groups) in & views {
406+ #[ cfg( any(
407+ not( feature = "webgl" ) ,
408+ not( target_arch = "wasm32" ) ,
409+ feature = "webgpu"
410+ ) ) ]
411+ let cache_key = (
412+ bloom_texture. texture . texture . id ( ) ,
413+ uniforms. buffer ( ) . unwrap ( ) . id ( ) ,
414+ ) ;
415+ #[ cfg( all( feature = "webgl" , target_arch = "wasm32" , not( feature = "webgpu" ) ) ) ]
416+ let cache_key = (
417+ bloom_texture
418+ . texture
419+ . iter ( )
420+ . map ( |tex| tex. texture . id ( ) )
421+ . collect ( ) ,
422+ uniforms. buffer ( ) . unwrap ( ) . id ( ) ,
423+ ) ;
424+
399425 if let Some ( b) = bloom_bind_groups
400- && b. cache_key
401- == (
402- bloom_texture. texture . texture . id ( ) ,
403- uniforms. buffer ( ) . unwrap ( ) . id ( ) ,
404- )
426+ && b. cache_key == cache_key
405427 {
406428 continue ;
407429 }
@@ -435,10 +457,7 @@ fn prepare_bloom_bind_groups(
435457 }
436458
437459 commands. entity ( entity) . insert ( BloomBindGroups {
438- cache_key : (
439- bloom_texture. texture . texture . id ( ) ,
440- uniforms. buffer ( ) . unwrap ( ) . id ( ) ,
441- ) ,
460+ cache_key,
442461 downsampling_bind_groups : downsampling_bind_groups. into_boxed_slice ( ) ,
443462 upsampling_bind_groups : upsampling_bind_groups. into_boxed_slice ( ) ,
444463 sampler : sampler. clone ( ) ,
0 commit comments