Skip to content

Commit dadd5af

Browse files
sagudevcwfitzgerald
authored andcommitted
Unify ResolvedComputePipelineDescriptor into ComputePipelineDescriptor
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 40f5763 commit dadd5af

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

wgpu-core/src/pipeline.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,27 +171,23 @@ pub enum ImplicitLayoutError {
171171
/// Describes a compute pipeline.
172172
#[derive(Clone, Debug)]
173173
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
174-
pub struct ComputePipelineDescriptor<'a> {
174+
pub struct ComputePipelineDescriptor<
175+
'a,
176+
PLL = PipelineLayoutId,
177+
SM = ShaderModuleId,
178+
PLC = PipelineCacheId,
179+
> {
175180
pub label: Label<'a>,
176181
/// The layout of bind groups for this pipeline.
177-
pub layout: Option<PipelineLayoutId>,
182+
pub layout: Option<PLL>,
178183
/// The compiled compute stage and its entry point.
179-
pub stage: ProgrammableStageDescriptor<'a>,
184+
pub stage: ProgrammableStageDescriptor<'a, SM>,
180185
/// The pipeline cache to use when creating this pipeline.
181-
pub cache: Option<PipelineCacheId>,
186+
pub cache: Option<PLC>,
182187
}
183188

184-
/// Describes a compute pipeline.
185-
#[derive(Clone, Debug)]
186-
pub struct ResolvedComputePipelineDescriptor<'a> {
187-
pub label: Label<'a>,
188-
/// The layout of bind groups for this pipeline.
189-
pub layout: Option<Arc<PipelineLayout>>,
190-
/// The compiled compute stage and its entry point.
191-
pub stage: ResolvedProgrammableStageDescriptor<'a>,
192-
/// The pipeline cache to use when creating this pipeline.
193-
pub cache: Option<Arc<PipelineCache>>,
194-
}
189+
pub type ResolvedComputePipelineDescriptor<'a> =
190+
ComputePipelineDescriptor<'a, Arc<PipelineLayout>, Arc<ShaderModule>, Arc<PipelineCache>>;
195191

196192
#[derive(Clone, Debug, Error)]
197193
#[non_exhaustive]

0 commit comments

Comments
 (0)