pub struct BlendPipelineSet {
pub globals_layout: BindGroupLayout,
pub normal: RenderPipeline,
pub multiply: RenderPipeline,
pub screen: RenderPipeline,
pub copy: RenderPipeline,
pub destination: RenderPipeline,
}Expand description
A set of pre-compiled solid-pass pipeline variants, one per blend mode.
Building this set at startup avoids pipeline creation at runtime when the
active blend mode changes. The set shares the globals_layout bind group
layout so a single globals bind group can be used across all modes.
Fields§
§globals_layout: BindGroupLayoutGlobals bind group layout (viewport uniform, group 0).
normal: RenderPipelineNormal blend mode pipeline (source-over).
multiply: RenderPipelineMultiply blend mode pipeline.
screen: RenderPipelineScreen blend mode pipeline.
copy: RenderPipelineCopy blend mode pipeline (replace destination).
destination: RenderPipelineDestination blend mode pipeline (keep destination, ignore source).
Implementations§
Source§impl BlendPipelineSet
impl BlendPipelineSet
Sourcepub fn new(device: &Device, sample_count: u32) -> Self
pub fn new(device: &Device, sample_count: u32) -> Self
Build all blend-mode pipeline variants.
sample_count controls MSAA (1 = no MSAA).
Sourcepub fn pipeline_for(&self, mode: BlendMode) -> &RenderPipeline
pub fn pipeline_for(&self, mode: BlendMode) -> &RenderPipeline
Return a reference to the pipeline for the given BlendMode.
Modes without a dedicated pipeline (Overlay, Darken, Lighten) fall back
to the Normal pipeline.
Auto Trait Implementations§
impl !RefUnwindSafe for BlendPipelineSet
impl !UnwindSafe for BlendPipelineSet
impl Freeze for BlendPipelineSet
impl Send for BlendPipelineSet
impl Sync for BlendPipelineSet
impl Unpin for BlendPipelineSet
impl UnsafeUnpin for BlendPipelineSet
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more