From c3bda444a163e96f27355f23ef16aa712aac1ac4 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Fri, 7 Feb 2025 10:48:01 +0100 Subject: [PATCH] Unify `ResolvedRenderPipelineDescriptor` into `RenderPipelineDescriptor` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- wgpu-core/src/pipeline.rs | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 4d611b6eb9..dcd9cf4922 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -324,12 +324,17 @@ pub type ResolvedFragmentState<'a> = FragmentState<'a, Arc>; /// Describes a render (graphics) pipeline. #[derive(Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct RenderPipelineDescriptor<'a> { +pub struct RenderPipelineDescriptor< + 'a, + PLL = PipelineLayoutId, + SM = ShaderModuleId, + PLC = PipelineCacheId, +> { pub label: Label<'a>, /// The layout of bind groups for this pipeline. - pub layout: Option, + pub layout: Option, /// The vertex processing state for this pipeline. - pub vertex: VertexState<'a>, + pub vertex: VertexState<'a, SM>, /// The properties of the pipeline at the primitive assembly and rasterization level. #[cfg_attr(feature = "serde", serde(default))] pub primitive: wgt::PrimitiveState, @@ -340,36 +345,16 @@ pub struct RenderPipelineDescriptor<'a> { #[cfg_attr(feature = "serde", serde(default))] pub multisample: wgt::MultisampleState, /// The fragment processing state for this pipeline. - pub fragment: Option>, + pub fragment: Option>, /// If the pipeline will be used with a multiview render pass, this indicates how many array /// layers the attachments will have. pub multiview: Option, /// The pipeline cache to use when creating this pipeline. - pub cache: Option, + pub cache: Option, } -/// Describes a render (graphics) pipeline. -#[derive(Clone, Debug)] -pub struct ResolvedRenderPipelineDescriptor<'a> { - pub label: Label<'a>, - /// The layout of bind groups for this pipeline. - pub layout: Option>, - /// The vertex processing state for this pipeline. - pub vertex: ResolvedVertexState<'a>, - /// The properties of the pipeline at the primitive assembly and rasterization level. - pub primitive: wgt::PrimitiveState, - /// The effect of draw calls on the depth and stencil aspects of the output target, if any. - pub depth_stencil: Option, - /// The multi-sampling properties of the pipeline. - pub multisample: wgt::MultisampleState, - /// The fragment processing state for this pipeline. - pub fragment: Option>, - /// If the pipeline will be used with a multiview render pass, this indicates how many array - /// layers the attachments will have. - pub multiview: Option, - /// The pipeline cache to use when creating this pipeline. - pub cache: Option>, -} +pub type ResolvedRenderPipelineDescriptor<'a> = + RenderPipelineDescriptor<'a, Arc, Arc, Arc>; #[derive(Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]