From dadd5af55cb1ca7cfea5dfcc0f66a7d879c7244c Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Fri, 7 Feb 2025 10:42:13 +0100 Subject: [PATCH] Unify `ResolvedComputePipelineDescriptor` into `ComputePipelineDescriptor` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- wgpu-core/src/pipeline.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 595e7e106..4d611b6eb 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -171,27 +171,23 @@ pub enum ImplicitLayoutError { /// Describes a compute pipeline. #[derive(Clone, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct ComputePipelineDescriptor<'a> { +pub struct ComputePipelineDescriptor< + '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 compiled compute stage and its entry point. - pub stage: ProgrammableStageDescriptor<'a>, + pub stage: ProgrammableStageDescriptor<'a, SM>, /// The pipeline cache to use when creating this pipeline. - pub cache: Option, + pub cache: Option, } -/// Describes a compute pipeline. -#[derive(Clone, Debug)] -pub struct ResolvedComputePipelineDescriptor<'a> { - pub label: Label<'a>, - /// The layout of bind groups for this pipeline. - pub layout: Option>, - /// The compiled compute stage and its entry point. - pub stage: ResolvedProgrammableStageDescriptor<'a>, - /// The pipeline cache to use when creating this pipeline. - pub cache: Option>, -} +pub type ResolvedComputePipelineDescriptor<'a> = + ComputePipelineDescriptor<'a, Arc, Arc, Arc>; #[derive(Clone, Debug, Error)] #[non_exhaustive]