pub struct RenderPipelineDesc<'a, D: Device> {
pub label: &'static str,
pub layouts: &'a [Option<&'a D::BindGroupLayout>],
pub shader: &'a D::ShaderModule,
pub vs_entry: &'static str,
pub fs_entry: Option<&'static str>,
pub color_targets: &'a [ColorTarget],
pub depth: Option<DepthState>,
pub topology: PrimitiveTopology,
pub constants: &'a [(&'static str, f64)],
}Expand description
Everything needed to create a render pipeline. Pipelines are created at load and cached; never inside the frame loop.
Fields§
§label: &'static strDebug label.
layouts: &'a [Option<&'a D::BindGroupLayout>]Bind-group layouts by group index (0 = per-frame, 1 = per-pass,
2 = per-representation, 3 = per-material); None leaves a
frequency slot unused without renumbering the groups after it.
shader: &'a D::ShaderModuleThe compiled module holding both entry points; modules are created once and shared across the pipelines that use them.
vs_entry: &'static strVertex entry point name.
fs_entry: Option<&'static str>Fragment entry point name; None for depth-only pipelines.
color_targets: &'a [ColorTarget]Color targets, in attachment order.
depth: Option<DepthState>Depth behavior, if the pass has a depth attachment.
topology: PrimitiveTopologyPrimitive assembly.
constants: &'a [(&'static str, f64)]Values for the shader’s override constants, by identifier.
Specializing at pipeline creation is what lets a shader resolve a shape, a sample count or a feature switch once, instead of branching on it in every fragment. Empty leaves every override at its default.