@@ -21,13 +21,13 @@ use crate::{
21
21
device:: {
22
22
bgl, Device , DeviceError , MissingDownlevelFlags , MissingFeatures , SHADER_STAGE_COUNT ,
23
23
} ,
24
- id:: { BindGroupLayoutId , BufferId , SamplerId , TextureViewId , TlasId } ,
24
+ id:: { BindGroupLayoutId , BufferId , ExternalTextureId , SamplerId , TextureViewId , TlasId } ,
25
25
init_tracker:: { BufferInitTrackerAction , TextureInitTrackerAction } ,
26
26
pipeline:: { ComputePipeline , RenderPipeline } ,
27
27
resource:: {
28
- Buffer , DestroyedResourceError , InvalidResourceError , Labeled , MissingBufferUsageError ,
29
- MissingTextureUsageError , RawResourceAccess , ResourceErrorIdent , Sampler , TextureView ,
30
- Tlas , TrackingData ,
28
+ Buffer , DestroyedResourceError , ExternalTexture , InvalidResourceError , Labeled ,
29
+ MissingBufferUsageError , MissingTextureUsageError , RawResourceAccess , ResourceErrorIdent ,
30
+ Sampler , TextureView , Tlas , TrackingData ,
31
31
} ,
32
32
resource_log,
33
33
snatch:: { SnatchGuard , Snatchable } ,
@@ -594,8 +594,14 @@ impl BindingTypeMaxCountValidator {
594
594
/// cbindgen:ignore
595
595
#[ derive( Clone , Debug ) ]
596
596
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
597
- pub struct BindGroupEntry < ' a , B = BufferId , S = SamplerId , TV = TextureViewId , TLAS = TlasId >
598
- where
597
+ pub struct BindGroupEntry <
598
+ ' a ,
599
+ B = BufferId ,
600
+ S = SamplerId ,
601
+ TV = TextureViewId ,
602
+ TLAS = TlasId ,
603
+ ET = ExternalTextureId ,
604
+ > where
599
605
[ BufferBinding < B > ] : ToOwned ,
600
606
[ S ] : ToOwned ,
601
607
[ TV ] : ToOwned ,
@@ -608,15 +614,21 @@ where
608
614
pub binding : u32 ,
609
615
#[ cfg_attr(
610
616
feature = "serde" ,
611
- serde( bound( deserialize = "BindingResource<'a, B, S, TV, TLAS>: Deserialize<'de>" ) )
617
+ serde( bound( deserialize = "BindingResource<'a, B, S, TV, TLAS, ET >: Deserialize<'de>" ) )
612
618
) ]
613
619
/// Resource to attach to the binding
614
- pub resource : BindingResource < ' a , B , S , TV , TLAS > ,
620
+ pub resource : BindingResource < ' a , B , S , TV , TLAS , ET > ,
615
621
}
616
622
617
623
/// cbindgen:ignore
618
- pub type ResolvedBindGroupEntry < ' a > =
619
- BindGroupEntry < ' a , Arc < Buffer > , Arc < Sampler > , Arc < TextureView > , Arc < Tlas > > ;
624
+ pub type ResolvedBindGroupEntry < ' a > = BindGroupEntry <
625
+ ' a ,
626
+ Arc < Buffer > ,
627
+ Arc < Sampler > ,
628
+ Arc < TextureView > ,
629
+ Arc < Tlas > ,
630
+ Arc < ExternalTexture > ,
631
+ > ;
620
632
621
633
/// Describes a group of bindings and the resources to be bound.
622
634
#[ derive( Clone , Debug ) ]
@@ -628,15 +640,16 @@ pub struct BindGroupDescriptor<
628
640
S = SamplerId ,
629
641
TV = TextureViewId ,
630
642
TLAS = TlasId ,
643
+ ET = ExternalTextureId ,
631
644
> where
632
645
[ BufferBinding < B > ] : ToOwned ,
633
646
[ S ] : ToOwned ,
634
647
[ TV ] : ToOwned ,
635
648
<[ BufferBinding < B > ] as ToOwned >:: Owned : fmt:: Debug ,
636
649
<[ S ] as ToOwned >:: Owned : fmt:: Debug ,
637
650
<[ TV ] as ToOwned >:: Owned : fmt:: Debug ,
638
- [ BindGroupEntry < ' a , B , S , TV , TLAS > ] : ToOwned ,
639
- <[ BindGroupEntry < ' a , B , S , TV , TLAS > ] as ToOwned >:: Owned : fmt:: Debug ,
651
+ [ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] : ToOwned ,
652
+ <[ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] as ToOwned >:: Owned : fmt:: Debug ,
640
653
{
641
654
/// Debug label of the bind group.
642
655
///
@@ -647,11 +660,12 @@ pub struct BindGroupDescriptor<
647
660
#[ cfg_attr(
648
661
feature = "serde" ,
649
662
serde( bound(
650
- deserialize = "<[BindGroupEntry<'a, B, S, TV, TLAS>] as ToOwned>::Owned: Deserialize<'de>"
663
+ deserialize = "<[BindGroupEntry<'a, B, S, TV, TLAS, ET >] as ToOwned>::Owned: Deserialize<'de>"
651
664
) )
652
665
) ]
653
666
/// The resources to bind to this bind group.
654
- pub entries : Cow < ' a , [ BindGroupEntry < ' a , B , S , TV , TLAS > ] > ,
667
+ #[ allow( clippy:: type_complexity) ]
668
+ pub entries : Cow < ' a , [ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] > ,
655
669
}
656
670
657
671
/// cbindgen:ignore
@@ -662,6 +676,7 @@ pub type ResolvedBindGroupDescriptor<'a> = BindGroupDescriptor<
662
676
Arc < Sampler > ,
663
677
Arc < TextureView > ,
664
678
Arc < Tlas > ,
679
+ Arc < ExternalTexture > ,
665
680
> ;
666
681
667
682
/// Describes a [`BindGroupLayout`].
@@ -1005,8 +1020,14 @@ pub type ResolvedBufferBinding = BufferBinding<Arc<Buffer>>;
1005
1020
// They're different enough that it doesn't make sense to share a common type
1006
1021
#[ derive( Debug , Clone ) ]
1007
1022
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
1008
- pub enum BindingResource < ' a , B = BufferId , S = SamplerId , TV = TextureViewId , TLAS = TlasId >
1009
- where
1023
+ pub enum BindingResource <
1024
+ ' a ,
1025
+ B = BufferId ,
1026
+ S = SamplerId ,
1027
+ TV = TextureViewId ,
1028
+ TLAS = TlasId ,
1029
+ ET = ExternalTextureId ,
1030
+ > where
1010
1031
[ BufferBinding < B > ] : ToOwned ,
1011
1032
[ S ] : ToOwned ,
1012
1033
[ TV ] : ToOwned ,
@@ -1033,10 +1054,17 @@ where
1033
1054
) ]
1034
1055
TextureViewArray ( Cow < ' a , [ TV ] > ) ,
1035
1056
AccelerationStructure ( TLAS ) ,
1057
+ ExternalTexture ( ET ) ,
1036
1058
}
1037
1059
1038
- pub type ResolvedBindingResource < ' a > =
1039
- BindingResource < ' a , Arc < Buffer > , Arc < Sampler > , Arc < TextureView > , Arc < Tlas > > ;
1060
+ pub type ResolvedBindingResource < ' a > = BindingResource <
1061
+ ' a ,
1062
+ Arc < Buffer > ,
1063
+ Arc < Sampler > ,
1064
+ Arc < TextureView > ,
1065
+ Arc < Tlas > ,
1066
+ Arc < ExternalTexture > ,
1067
+ > ;
1040
1068
1041
1069
#[ derive( Clone , Debug , Error ) ]
1042
1070
#[ non_exhaustive]
0 commit comments