Skip to main content

RenderPipelineDesc

Struct RenderPipelineDesc 

Source
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 str

Debug 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::ShaderModule

The compiled module holding both entry points; modules are created once and shared across the pipelines that use them.

§vs_entry: &'static str

Vertex 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: PrimitiveTopology

Primitive 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.

Trait Implementations§

Source§

impl<'a, D: Debug + Device> Debug for RenderPipelineDesc<'a, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D> Freeze for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: Freeze, &'a <D as Device>::ShaderModule: Freeze,

§

impl<'a, D> RefUnwindSafe for RenderPipelineDesc<'a, D>

§

impl<'a, D> Send for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: Send, &'a <D as Device>::ShaderModule: Send,

§

impl<'a, D> Sync for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: Sync, &'a <D as Device>::ShaderModule: Sync,

§

impl<'a, D> Unpin for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: Unpin, &'a <D as Device>::ShaderModule: Unpin,

§

impl<'a, D> UnsafeUnpin for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: UnsafeUnpin, &'a <D as Device>::ShaderModule: UnsafeUnpin,

§

impl<'a, D> UnwindSafe for RenderPipelineDesc<'a, D>
where &'a [Option<&'a <D as Device>::BindGroupLayout>]: UnwindSafe, &'a <D as Device>::ShaderModule: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.