@@ -465,29 +465,47 @@ pub type ResolvedBindGroupEntry<'a> =
465
465
/// Describes a group of bindings and the resources to be bound.
466
466
#[ derive( Clone , Debug ) ]
467
467
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
468
- pub struct BindGroupDescriptor < ' a > {
468
+ pub struct BindGroupDescriptor <
469
+ ' a ,
470
+ BGL = BindGroupLayoutId ,
471
+ B = BufferId ,
472
+ S = SamplerId ,
473
+ TV = TextureViewId ,
474
+ TLAS = TlasId ,
475
+ > where
476
+ [ BufferBinding < B > ] : ToOwned ,
477
+ [ S ] : ToOwned ,
478
+ [ TV ] : ToOwned ,
479
+ <[ BufferBinding < B > ] as ToOwned >:: Owned : std:: fmt:: Debug ,
480
+ <[ S ] as ToOwned >:: Owned : std:: fmt:: Debug ,
481
+ <[ TV ] as ToOwned >:: Owned : std:: fmt:: Debug ,
482
+ [ BindGroupEntry < ' a , B , S , TV , TLAS > ] : ToOwned ,
483
+ <[ BindGroupEntry < ' a , B , S , TV , TLAS > ] as ToOwned >:: Owned : std:: fmt:: Debug ,
484
+ {
469
485
/// Debug label of the bind group.
470
486
///
471
487
/// This will show up in graphics debuggers for easy identification.
472
488
pub label : Label < ' a > ,
473
489
/// The [`BindGroupLayout`] that corresponds to this bind group.
474
- pub layout : BindGroupLayoutId ,
490
+ pub layout : BGL ,
491
+ #[ cfg_attr(
492
+ feature = "serde" ,
493
+ serde( bound(
494
+ deserialize = "<[BindGroupEntry<'a, B, S, TV, TLAS>] as ToOwned>::Owned: Deserialize<'de>"
495
+ ) )
496
+ ) ]
475
497
/// The resources to bind to this bind group.
476
- pub entries : Cow < ' a , [ BindGroupEntry < ' a > ] > ,
498
+ pub entries : Cow < ' a , [ BindGroupEntry < ' a , B , S , TV , TLAS > ] > ,
477
499
}
478
500
479
- /// Describes a group of bindings and the resources to be bound.
480
- #[ derive( Clone , Debug ) ]
481
- pub struct ResolvedBindGroupDescriptor < ' a > {
482
- /// Debug label of the bind group.
483
- ///
484
- /// This will show up in graphics debuggers for easy identification.
485
- pub label : Label < ' a > ,
486
- /// The [`BindGroupLayout`] that corresponds to this bind group.
487
- pub layout : Arc < BindGroupLayout > ,
488
- /// The resources to bind to this bind group.
489
- pub entries : Cow < ' a , [ ResolvedBindGroupEntry < ' a > ] > ,
490
- }
501
+ pub type ResolvedBindGroupDescriptor < ' a > = BindGroupDescriptor <
502
+ ' a ,
503
+ Arc < BindGroupLayout > ,
504
+ Arc < Buffer > ,
505
+ Arc < Sampler > ,
506
+ Arc < TextureView > ,
507
+ Arc < Tlas > ,
508
+ > ;
491
509
492
510
/// Describes a [`BindGroupLayout`].
493
511
#[ derive( Clone , Debug ) ]
0 commit comments