Skip to content

Commit e14e397

Browse files
sagudevcwfitzgerald
authored andcommitted
Unify ResolvedProgrammableStageDescriptor into ProgrammableStageDescriptor
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 8e943e8 commit e14e397

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

wgpu-core/src/pipeline.rs

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ pub enum CreateShaderModuleError {
122122
/// Describes a programmable pipeline stage.
123123
#[derive(Clone, Debug)]
124124
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
125-
pub struct ProgrammableStageDescriptor<'a> {
125+
pub struct ProgrammableStageDescriptor<'a, SM = ShaderModuleId> {
126126
/// The compiled shader module for this stage.
127-
pub module: ShaderModuleId,
127+
pub module: SM,
128128
/// The name of the entry point in the compiled shader. The name is selected using the
129129
/// following logic:
130130
///
@@ -147,32 +147,8 @@ pub struct ProgrammableStageDescriptor<'a> {
147147
pub zero_initialize_workgroup_memory: bool,
148148
}
149149

150-
/// Describes a programmable pipeline stage.
151-
#[derive(Clone, Debug)]
152-
pub struct ResolvedProgrammableStageDescriptor<'a> {
153-
/// The compiled shader module for this stage.
154-
pub module: Arc<ShaderModule>,
155-
/// The name of the entry point in the compiled shader. The name is selected using the
156-
/// following logic:
157-
///
158-
/// * If `Some(name)` is specified, there must be a function with this name in the shader.
159-
/// * If a single entry point associated with this stage must be in the shader, then proceed as
160-
/// if `Some(…)` was specified with that entry point's name.
161-
pub entry_point: Option<Cow<'a, str>>,
162-
/// Specifies the values of pipeline-overridable constants in the shader module.
163-
///
164-
/// If an `@id` attribute was specified on the declaration,
165-
/// the key must be the pipeline constant ID as a decimal ASCII number; if not,
166-
/// the key must be the constant's identifier name.
167-
///
168-
/// The value may represent any of WGSL's concrete scalar types.
169-
pub constants: Cow<'a, naga::back::PipelineConstants>,
170-
/// Whether workgroup scoped memory will be initialized with zero values for this stage.
171-
///
172-
/// This is required by the WebGPU spec, but may have overhead which can be avoided
173-
/// for cross-platform applications
174-
pub zero_initialize_workgroup_memory: bool,
175-
}
150+
pub type ResolvedProgrammableStageDescriptor<'a> =
151+
ProgrammableStageDescriptor<'a, Arc<ShaderModule>>;
176152

177153
/// Number of implicit bind groups derived at pipeline creation.
178154
pub type ImplicitBindGroupCount = u8;

0 commit comments

Comments
 (0)