@@ -795,14 +795,14 @@ impl Global {
795
795
Err ( ..) => break ' error binding_model:: CreateBindGroupError :: InvalidLayout ,
796
796
} ;
797
797
798
- fn map_entry < ' a > (
798
+ fn resolve_entry < ' a > (
799
799
e : & BindGroupEntry < ' a > ,
800
800
buffer_storage : & Storage < resource:: Buffer > ,
801
801
sampler_storage : & Storage < resource:: Sampler > ,
802
802
texture_view_storage : & Storage < resource:: TextureView > ,
803
803
) -> Result < ResolvedBindGroupEntry < ' a > , binding_model:: CreateBindGroupError >
804
804
{
805
- let map_buffer = |bb : & BufferBinding | {
805
+ let resolve_buffer = |bb : & BufferBinding | {
806
806
buffer_storage
807
807
. get_owned ( bb. buffer_id )
808
808
. map ( |buffer| ResolvedBufferBinding {
@@ -814,42 +814,45 @@ impl Global {
814
814
binding_model:: CreateBindGroupError :: InvalidBufferId ( bb. buffer_id )
815
815
} )
816
816
} ;
817
- let map_sampler = |id : & id:: SamplerId | {
817
+ let resolve_sampler = |id : & id:: SamplerId | {
818
818
sampler_storage
819
819
. get_owned ( * id)
820
820
. map_err ( |_| binding_model:: CreateBindGroupError :: InvalidSamplerId ( * id) )
821
821
} ;
822
- let map_view = |id : & id:: TextureViewId | {
822
+ let resolve_view = |id : & id:: TextureViewId | {
823
823
texture_view_storage
824
824
. get_owned ( * id)
825
825
. map_err ( |_| binding_model:: CreateBindGroupError :: InvalidTextureViewId ( * id) )
826
826
} ;
827
827
let resource = match e. resource {
828
828
BindingResource :: Buffer ( ref buffer) => {
829
- ResolvedBindingResource :: Buffer ( map_buffer ( buffer) ?)
829
+ ResolvedBindingResource :: Buffer ( resolve_buffer ( buffer) ?)
830
830
}
831
831
BindingResource :: BufferArray ( ref buffers) => {
832
832
let buffers = buffers
833
833
. iter ( )
834
- . map ( map_buffer )
834
+ . map ( resolve_buffer )
835
835
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
836
836
ResolvedBindingResource :: BufferArray ( Cow :: Owned ( buffers) )
837
837
}
838
838
BindingResource :: Sampler ( ref sampler) => {
839
- ResolvedBindingResource :: Sampler ( map_sampler ( sampler) ?)
839
+ ResolvedBindingResource :: Sampler ( resolve_sampler ( sampler) ?)
840
840
}
841
841
BindingResource :: SamplerArray ( ref samplers) => {
842
842
let samplers = samplers
843
843
. iter ( )
844
- . map ( map_sampler )
844
+ . map ( resolve_sampler )
845
845
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
846
846
ResolvedBindingResource :: SamplerArray ( Cow :: Owned ( samplers) )
847
847
}
848
848
BindingResource :: TextureView ( ref view) => {
849
- ResolvedBindingResource :: TextureView ( map_view ( view) ?)
849
+ ResolvedBindingResource :: TextureView ( resolve_view ( view) ?)
850
850
}
851
851
BindingResource :: TextureViewArray ( ref views) => {
852
- let views = views. iter ( ) . map ( map_view) . collect :: < Result < Vec < _ > , _ > > ( ) ?;
852
+ let views = views
853
+ . iter ( )
854
+ . map ( resolve_view)
855
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
853
856
ResolvedBindingResource :: TextureViewArray ( Cow :: Owned ( views) )
854
857
}
855
858
} ;
@@ -865,7 +868,7 @@ impl Global {
865
868
let sampler_guard = hub. samplers . read ( ) ;
866
869
desc. entries
867
870
. iter ( )
868
- . map ( |e| map_entry ( e, & buffer_guard, & sampler_guard, & texture_view_guard) )
871
+ . map ( |e| resolve_entry ( e, & buffer_guard, & sampler_guard, & texture_view_guard) )
869
872
. collect :: < Result < Vec < _ > , _ > > ( )
870
873
} ;
871
874
let entries = match entries {
0 commit comments