Skip to content

Commit c3bda44

Browse files
sagudevcwfitzgerald
authored andcommitted
Unify ResolvedRenderPipelineDescriptor into RenderPipelineDescriptor
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent dadd5af commit c3bda44

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

wgpu-core/src/pipeline.rs

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,17 @@ pub type ResolvedFragmentState<'a> = FragmentState<'a, Arc<ShaderModule>>;
324324
/// Describes a render (graphics) pipeline.
325325
#[derive(Clone, Debug)]
326326
#[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+
> {
328333
pub label: Label<'a>,
329334
/// The layout of bind groups for this pipeline.
330-
pub layout: Option<PipelineLayoutId>,
335+
pub layout: Option<PLL>,
331336
/// The vertex processing state for this pipeline.
332-
pub vertex: VertexState<'a>,
337+
pub vertex: VertexState<'a, SM>,
333338
/// The properties of the pipeline at the primitive assembly and rasterization level.
334339
#[cfg_attr(feature = "serde", serde(default))]
335340
pub primitive: wgt::PrimitiveState,
@@ -340,36 +345,16 @@ pub struct RenderPipelineDescriptor<'a> {
340345
#[cfg_attr(feature = "serde", serde(default))]
341346
pub multisample: wgt::MultisampleState,
342347
/// The fragment processing state for this pipeline.
343-
pub fragment: Option<FragmentState<'a>>,
348+
pub fragment: Option<FragmentState<'a, SM>>,
344349
/// If the pipeline will be used with a multiview render pass, this indicates how many array
345350
/// layers the attachments will have.
346351
pub multiview: Option<NonZeroU32>,
347352
/// The pipeline cache to use when creating this pipeline.
348-
pub cache: Option<PipelineCacheId>,
353+
pub cache: Option<PLC>,
349354
}
350355

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>>;
373358

374359
#[derive(Clone, Debug)]
375360
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

0 commit comments

Comments
 (0)