@@ -19,12 +19,13 @@ use crate::{
19
19
device:: {
20
20
bgl, Device , DeviceError , MissingDownlevelFlags , MissingFeatures , SHADER_STAGE_COUNT ,
21
21
} ,
22
- id:: { BindGroupLayoutId , BufferId , SamplerId , TextureViewId , TlasId } ,
22
+ id:: { BindGroupLayoutId , BufferId , ExternalTextureId , SamplerId , TextureViewId , TlasId } ,
23
23
init_tracker:: { BufferInitTrackerAction , TextureInitTrackerAction } ,
24
24
pipeline:: { ComputePipeline , RenderPipeline } ,
25
25
resource:: {
26
- Buffer , DestroyedResourceError , InvalidResourceError , Labeled , MissingBufferUsageError ,
27
- MissingTextureUsageError , ResourceErrorIdent , Sampler , TextureView , Tlas , TrackingData ,
26
+ Buffer , DestroyedResourceError , ExternalTexture , InvalidResourceError , Labeled ,
27
+ MissingBufferUsageError , MissingTextureUsageError , ResourceErrorIdent , Sampler ,
28
+ TextureView , Tlas , TrackingData ,
28
29
} ,
29
30
resource_log,
30
31
snatch:: { SnatchGuard , Snatchable } ,
@@ -492,8 +493,14 @@ impl BindingTypeMaxCountValidator {
492
493
/// cbindgen:ignore
493
494
#[ derive( Clone , Debug ) ]
494
495
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
495
- pub struct BindGroupEntry < ' a , B = BufferId , S = SamplerId , TV = TextureViewId , TLAS = TlasId >
496
- where
496
+ pub struct BindGroupEntry <
497
+ ' a ,
498
+ B = BufferId ,
499
+ S = SamplerId ,
500
+ TV = TextureViewId ,
501
+ TLAS = TlasId ,
502
+ ET = ExternalTextureId ,
503
+ > where
497
504
[ BufferBinding < B > ] : ToOwned ,
498
505
[ S ] : ToOwned ,
499
506
[ TV ] : ToOwned ,
@@ -506,15 +513,21 @@ where
506
513
pub binding : u32 ,
507
514
#[ cfg_attr(
508
515
feature = "serde" ,
509
- serde( bound( deserialize = "BindingResource<'a, B, S, TV, TLAS>: Deserialize<'de>" ) )
516
+ serde( bound( deserialize = "BindingResource<'a, B, S, TV, TLAS, ET >: Deserialize<'de>" ) )
510
517
) ]
511
518
/// Resource to attach to the binding
512
- pub resource : BindingResource < ' a , B , S , TV , TLAS > ,
519
+ pub resource : BindingResource < ' a , B , S , TV , TLAS , ET > ,
513
520
}
514
521
515
522
/// cbindgen:ignore
516
- pub type ResolvedBindGroupEntry < ' a > =
517
- BindGroupEntry < ' a , Arc < Buffer > , Arc < Sampler > , Arc < TextureView > , Arc < Tlas > > ;
523
+ pub type ResolvedBindGroupEntry < ' a > = BindGroupEntry <
524
+ ' a ,
525
+ Arc < Buffer > ,
526
+ Arc < Sampler > ,
527
+ Arc < TextureView > ,
528
+ Arc < Tlas > ,
529
+ Arc < ExternalTexture > ,
530
+ > ;
518
531
519
532
/// Describes a group of bindings and the resources to be bound.
520
533
#[ derive( Clone , Debug ) ]
@@ -526,15 +539,16 @@ pub struct BindGroupDescriptor<
526
539
S = SamplerId ,
527
540
TV = TextureViewId ,
528
541
TLAS = TlasId ,
542
+ ET = ExternalTextureId ,
529
543
> where
530
544
[ BufferBinding < B > ] : ToOwned ,
531
545
[ S ] : ToOwned ,
532
546
[ TV ] : ToOwned ,
533
547
<[ BufferBinding < B > ] as ToOwned >:: Owned : fmt:: Debug ,
534
548
<[ S ] as ToOwned >:: Owned : fmt:: Debug ,
535
549
<[ TV ] as ToOwned >:: Owned : fmt:: Debug ,
536
- [ BindGroupEntry < ' a , B , S , TV , TLAS > ] : ToOwned ,
537
- <[ BindGroupEntry < ' a , B , S , TV , TLAS > ] as ToOwned >:: Owned : fmt:: Debug ,
550
+ [ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] : ToOwned ,
551
+ <[ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] as ToOwned >:: Owned : fmt:: Debug ,
538
552
{
539
553
/// Debug label of the bind group.
540
554
///
@@ -545,11 +559,12 @@ pub struct BindGroupDescriptor<
545
559
#[ cfg_attr(
546
560
feature = "serde" ,
547
561
serde( bound(
548
- deserialize = "<[BindGroupEntry<'a, B, S, TV, TLAS>] as ToOwned>::Owned: Deserialize<'de>"
562
+ deserialize = "<[BindGroupEntry<'a, B, S, TV, TLAS, ET >] as ToOwned>::Owned: Deserialize<'de>"
549
563
) )
550
564
) ]
551
565
/// The resources to bind to this bind group.
552
- pub entries : Cow < ' a , [ BindGroupEntry < ' a , B , S , TV , TLAS > ] > ,
566
+ #[ allow( clippy:: type_complexity) ]
567
+ pub entries : Cow < ' a , [ BindGroupEntry < ' a , B , S , TV , TLAS , ET > ] > ,
553
568
}
554
569
555
570
/// cbindgen:ignore
@@ -560,6 +575,7 @@ pub type ResolvedBindGroupDescriptor<'a> = BindGroupDescriptor<
560
575
Arc < Sampler > ,
561
576
Arc < TextureView > ,
562
577
Arc < Tlas > ,
578
+ Arc < ExternalTexture > ,
563
579
> ;
564
580
565
581
/// Describes a [`BindGroupLayout`].
@@ -881,8 +897,14 @@ pub type ResolvedBufferBinding = BufferBinding<Arc<Buffer>>;
881
897
// They're different enough that it doesn't make sense to share a common type
882
898
#[ derive( Debug , Clone ) ]
883
899
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
884
- pub enum BindingResource < ' a , B = BufferId , S = SamplerId , TV = TextureViewId , TLAS = TlasId >
885
- where
900
+ pub enum BindingResource <
901
+ ' a ,
902
+ B = BufferId ,
903
+ S = SamplerId ,
904
+ TV = TextureViewId ,
905
+ TLAS = TlasId ,
906
+ ET = ExternalTextureId ,
907
+ > where
886
908
[ BufferBinding < B > ] : ToOwned ,
887
909
[ S ] : ToOwned ,
888
910
[ TV ] : ToOwned ,
@@ -909,10 +931,17 @@ where
909
931
) ]
910
932
TextureViewArray ( Cow < ' a , [ TV ] > ) ,
911
933
AccelerationStructure ( TLAS ) ,
934
+ ExternalTexture ( ET ) ,
912
935
}
913
936
914
- pub type ResolvedBindingResource < ' a > =
915
- BindingResource < ' a , Arc < Buffer > , Arc < Sampler > , Arc < TextureView > , Arc < Tlas > > ;
937
+ pub type ResolvedBindingResource < ' a > = BindingResource <
938
+ ' a ,
939
+ Arc < Buffer > ,
940
+ Arc < Sampler > ,
941
+ Arc < TextureView > ,
942
+ Arc < Tlas > ,
943
+ Arc < ExternalTexture > ,
944
+ > ;
916
945
917
946
#[ derive( Clone , Debug , Error ) ]
918
947
#[ non_exhaustive]
0 commit comments