@@ -324,12 +324,17 @@ pub type ResolvedFragmentState<'a> = FragmentState<'a, Arc<ShaderModule>>;
324
324
/// Describes a render (graphics) pipeline.
325
325
#[ derive( Clone , Debug ) ]
326
326
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
327
- pub struct RenderPipelineDescriptor < ' a > {
327
+ pub struct RenderPipelineDescriptor <
328
+ ' a ,
329
+ PLL = PipelineLayoutId ,
330
+ SM = ShaderModuleId ,
331
+ PLC = PipelineCacheId ,
332
+ > {
328
333
pub label : Label < ' a > ,
329
334
/// The layout of bind groups for this pipeline.
330
- pub layout : Option < PipelineLayoutId > ,
335
+ pub layout : Option < PLL > ,
331
336
/// The vertex processing state for this pipeline.
332
- pub vertex : VertexState < ' a > ,
337
+ pub vertex : VertexState < ' a , SM > ,
333
338
/// The properties of the pipeline at the primitive assembly and rasterization level.
334
339
#[ cfg_attr( feature = "serde" , serde( default ) ) ]
335
340
pub primitive : wgt:: PrimitiveState ,
@@ -340,36 +345,16 @@ pub struct RenderPipelineDescriptor<'a> {
340
345
#[ cfg_attr( feature = "serde" , serde( default ) ) ]
341
346
pub multisample : wgt:: MultisampleState ,
342
347
/// The fragment processing state for this pipeline.
343
- pub fragment : Option < FragmentState < ' a > > ,
348
+ pub fragment : Option < FragmentState < ' a , SM > > ,
344
349
/// If the pipeline will be used with a multiview render pass, this indicates how many array
345
350
/// layers the attachments will have.
346
351
pub multiview : Option < NonZeroU32 > ,
347
352
/// The pipeline cache to use when creating this pipeline.
348
- pub cache : Option < PipelineCacheId > ,
353
+ pub cache : Option < PLC > ,
349
354
}
350
355
351
- /// Describes a render (graphics) pipeline.
352
- #[ derive( Clone , Debug ) ]
353
- pub struct ResolvedRenderPipelineDescriptor < ' a > {
354
- pub label : Label < ' a > ,
355
- /// The layout of bind groups for this pipeline.
356
- pub layout : Option < Arc < PipelineLayout > > ,
357
- /// The vertex processing state for this pipeline.
358
- pub vertex : ResolvedVertexState < ' a > ,
359
- /// The properties of the pipeline at the primitive assembly and rasterization level.
360
- pub primitive : wgt:: PrimitiveState ,
361
- /// The effect of draw calls on the depth and stencil aspects of the output target, if any.
362
- pub depth_stencil : Option < wgt:: DepthStencilState > ,
363
- /// The multi-sampling properties of the pipeline.
364
- pub multisample : wgt:: MultisampleState ,
365
- /// The fragment processing state for this pipeline.
366
- pub fragment : Option < ResolvedFragmentState < ' a > > ,
367
- /// If the pipeline will be used with a multiview render pass, this indicates how many array
368
- /// layers the attachments will have.
369
- pub multiview : Option < NonZeroU32 > ,
370
- /// The pipeline cache to use when creating this pipeline.
371
- pub cache : Option < Arc < PipelineCache > > ,
372
- }
356
+ pub type ResolvedRenderPipelineDescriptor < ' a > =
357
+ RenderPipelineDescriptor < ' a , Arc < PipelineLayout > , Arc < ShaderModule > , Arc < PipelineCache > > ;
373
358
374
359
#[ derive( Clone , Debug ) ]
375
360
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
0 commit comments