pub struct RenderPipelineDesc {
pub shader: ShaderId,
pub vs: Cow<'static, str>,
pub fs: Cow<'static, str>,
pub vertex_layouts: Vec<VertexLayout>,
pub blend: Option<BlendState>,
pub format: TextureFormat,
pub sample_count: u32,
pub depth: Option<DepthStencilState>,
pub topology: PrimitiveTopology,
}Expand description
One render-pipeline variant, as a plain hashable value.
Build the descs an app needs at start-up, hand them to
PipelineCache::warm_up, and keep them around: a per-frame
PipelineCache::get_or_create takes one by reference and never allocates
on a hit.
The pipeline’s bind-group layout is always wgpu’s default layout, deduced from the shader modules — there is no explicit-layout axis in v1, so a variant set that needs one is out of this cache’s scope.
Fields§
§shader: ShaderIdThe module holding both entry points, from the cache’s own library.
vs: Cow<'static, str>Vertex entry point name.
fs: Cow<'static, str>Fragment entry point name.
vertex_layouts: Vec<VertexLayout>Vertex buffer layouts, in bind order. Empty for a shader that generates its own vertices (a fullscreen triangle).
blend: Option<BlendState>Color blending, or None for an opaque write.
format: TextureFormatColor target format.
sample_count: u32MSAA sample count; must be a power of two, 1 for no MSAA.
depth: Option<DepthStencilState>Depth/stencil state, or None for a color-only pass.
topology: PrimitiveTopologyPrimitive topology. Strip topologies here are non-indexed only: the
desc carries no strip_index_format.
Implementations§
Trait Implementations§
Source§impl Clone for RenderPipelineDesc
impl Clone for RenderPipelineDesc
Source§impl Debug for RenderPipelineDesc
impl Debug for RenderPipelineDesc
impl Eq for RenderPipelineDesc
Source§impl Hash for RenderPipelineDesc
impl Hash for RenderPipelineDesc
Source§impl PartialEq for RenderPipelineDesc
impl PartialEq for RenderPipelineDesc
impl StructuralPartialEq for RenderPipelineDesc
Auto Trait Implementations§
impl Freeze for RenderPipelineDesc
impl RefUnwindSafe for RenderPipelineDesc
impl Send for RenderPipelineDesc
impl Sync for RenderPipelineDesc
impl Unpin for RenderPipelineDesc
impl UnsafeUnpin for RenderPipelineDesc
impl UnwindSafe for RenderPipelineDesc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.