@@ -641,14 +641,23 @@ pub enum PushConstantUploadError {
641
641
/// A `PipelineLayoutDescriptor` can be used to create a pipeline layout.
642
642
#[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
643
643
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
644
- pub struct PipelineLayoutDescriptor < ' a > {
644
+ #[ cfg_attr( feature = "serde" , serde( bound = "BGL: Serialize" ) ) ]
645
+ pub struct PipelineLayoutDescriptor < ' a , BGL = BindGroupLayoutId >
646
+ where
647
+ [ BGL ] : ToOwned ,
648
+ <[ BGL ] as ToOwned >:: Owned : std:: fmt:: Debug ,
649
+ {
645
650
/// Debug label of the pipeline layout.
646
651
///
647
652
/// This will show up in graphics debuggers for easy identification.
648
653
pub label : Label < ' a > ,
649
654
/// Bind groups that this pipeline uses. The first entry will provide all the bindings for
650
655
/// "set = 0", second entry will provide all the bindings for "set = 1" etc.
651
- pub bind_group_layouts : Cow < ' a , [ BindGroupLayoutId ] > ,
656
+ #[ cfg_attr(
657
+ feature = "serde" ,
658
+ serde( bound( deserialize = "<[BGL] as ToOwned>::Owned: Deserialize<'de>" ) )
659
+ ) ]
660
+ pub bind_group_layouts : Cow < ' a , [ BGL ] > ,
652
661
/// Set of push constant ranges this pipeline uses. Each shader stage that
653
662
/// uses push constants must define the range in push constant memory that
654
663
/// corresponds to its single `layout(push_constant)` uniform block.
@@ -659,27 +668,7 @@ pub struct PipelineLayoutDescriptor<'a> {
659
668
pub push_constant_ranges : Cow < ' a , [ wgt:: PushConstantRange ] > ,
660
669
}
661
670
662
- /// Describes a pipeline layout.
663
- ///
664
- /// A `PipelineLayoutDescriptor` can be used to create a pipeline layout.
665
- #[ derive( Debug ) ]
666
- pub struct ResolvedPipelineLayoutDescriptor < ' a > {
667
- /// Debug label of the pipeline layout.
668
- ///
669
- /// This will show up in graphics debuggers for easy identification.
670
- pub label : Label < ' a > ,
671
- /// Bind groups that this pipeline uses. The first entry will provide all the bindings for
672
- /// "set = 0", second entry will provide all the bindings for "set = 1" etc.
673
- pub bind_group_layouts : Cow < ' a , [ Arc < BindGroupLayout > ] > ,
674
- /// Set of push constant ranges this pipeline uses. Each shader stage that
675
- /// uses push constants must define the range in push constant memory that
676
- /// corresponds to its single `layout(push_constant)` uniform block.
677
- ///
678
- /// If this array is non-empty, the
679
- /// [`Features::PUSH_CONSTANTS`](wgt::Features::PUSH_CONSTANTS) feature must
680
- /// be enabled.
681
- pub push_constant_ranges : Cow < ' a , [ wgt:: PushConstantRange ] > ,
682
- }
671
+ pub type ResolvedPipelineLayoutDescriptor < ' a > = PipelineLayoutDescriptor < ' a , Arc < BindGroupLayout > > ;
683
672
684
673
#[ derive( Debug ) ]
685
674
pub struct PipelineLayout {
0 commit comments