pub enum EnginePipeline {
StripIntermediate,
StripAlpha,
StripDepthAlpha,
StripOpaque,
StripDestOut,
StripDepthDestOut,
Clear,
Copy,
Filter,
}Expand description
One of the engine’s render pipelines.
Variants§
StripIntermediate
Strips into an INTERMEDIATE_FORMAT off-screen target.
StripAlpha
Strips into the frame’s own target, alpha-blended, no depth.
StripDepthAlpha
Strips into the frame’s own target, alpha-blended, depth-tested but not depth-writing.
StripOpaque
Strips into the frame’s own target, opaque, depth-tested and depth-writing.
StripDestOut
Hole-punch coverage into the frame’s own target, destination-out, no depth.
StripDepthDestOut
Hole-punch coverage into the frame’s own target, destination-out, depth-tested but not depth-writing.
Clear
Clears rectangular regions of an intermediate target.
Copy
Copies rectangular regions between intermediate targets.
Filter
Runs one pass of a layer filter’s sequence into an intermediate target, reading the other page of the pair through a bilinear sampler.
Implementations§
Source§impl EnginePipeline
impl EnginePipeline
Sourcepub const fn index(self) -> usize
pub const fn index(self) -> usize
This pipeline’s position in Self::ALL — a dense index for tables
keyed by render state.
Sourcepub const fn serves(self, class: PaintClass) -> bool
pub const fn serves(self, class: PaintClass) -> bool
Whether this strip state is ever compiled with class’s program.
Every strip state serves PaintClass::Uber and
PaintClass::SolidCoverage; the destination-out pair serves nothing
else (a punch erases with a solid source), and the opaque state serves
the classes a fully covered opaque span can have — solid, gradient,
either image class — but never a composite or a blurred rectangle,
neither of which is ever opaque. The glyph class is served wherever an
image is. A non-strip pipeline serves only Uber, which for it means
“its own program”.
Sourcepub const fn fold_class(self, class: PaintClass) -> PaintClass
pub const fn fold_class(self, class: PaintClass) -> PaintClass
The class this state actually draws a run of class with: the class
itself when served, PaintClass::Uber — which draws everything —
when not.
Sourcepub const fn is_strip(self) -> bool
pub const fn is_strip(self) -> bool
Whether this pipeline rasterizes strips (as opposed to clearing or copying an intermediate).
Sourcepub const fn bind_group_count(self) -> usize
pub const fn bind_group_count(self) -> usize
How many bind groups the pipeline’s program declares.
Four is the WebGL2 ceiling, which the strip programs sit exactly on.
Sourcepub const fn format(self, target_format: TextureFormat) -> TextureFormat
pub const fn format(self, target_format: TextureFormat) -> TextureFormat
The color format this pipeline writes, given the frame’s target format.
Only the variants that draw into the frame’s own target take it; the
rest are pinned to INTERMEDIATE_FORMAT.
Sourcepub const fn blend(self) -> Option<BlendState>
pub const fn blend(self) -> Option<BlendState>
The color blending this pipeline uses, or None for an opaque write.
Sourcepub fn depth(self) -> Option<DepthStencilState>
pub fn depth(self) -> Option<DepthStencilState>
The depth state this pipeline uses, or None for a color-only pass.
Sourcepub fn vertex_layouts(self) -> Vec<VertexLayout>
pub fn vertex_layouts(self) -> Vec<VertexLayout>
The vertex buffer layouts this pipeline steps over.
Sourcepub const fn module(self) -> EngineShaderModule
pub const fn module(self) -> EngineShaderModule
Which module this pipeline draws with.
Sourcepub fn shader(self, shaders: &EngineShaders) -> ShaderId
pub fn shader(self, shaders: &EngineShaders) -> ShaderId
The registered id of the module this pipeline draws with — for a
strip state, the whole (PaintClass::Uber) program.
Sourcepub fn class_shader(
self,
shaders: &EngineShaders,
class: PaintClass,
) -> ShaderId
pub fn class_shader( self, shaders: &EngineShaders, class: PaintClass, ) -> ShaderId
The registered id of the module this pipeline draws class with: the
class’s specialisation for a strip state that serves it, the Uber
program for one that does not, and the pipeline’s own module for a
non-strip pipeline (which has no class axis).
Sourcepub fn desc(
self,
shaders: &EngineShaders,
target_format: TextureFormat,
) -> RenderPipelineDesc
pub fn desc( self, shaders: &EngineShaders, target_format: TextureFormat, ) -> RenderPipelineDesc
The full pipeline description of this state’s whole
(PaintClass::Uber) program, ready for
PipelineCache::get_or_create or PipelineCache::warm_up.
sample_count is always 1: the engine never multisamples, since a
downlevel target cannot.
Sourcepub fn class_desc(
self,
shaders: &EngineShaders,
target_format: TextureFormat,
class: PaintClass,
) -> RenderPipelineDesc
pub fn class_desc( self, shaders: &EngineShaders, target_format: TextureFormat, class: PaintClass, ) -> RenderPipelineDesc
The full pipeline description of this state drawing class — folded
to Uber when the state does not serve it (Self::fold_class), and
ignored by a non-strip pipeline.
A strip description names the shared explicit strip layout, so every class of every strip state accepts the same bind groups; the clear, copy and filter pipelines keep wgpu’s derived layout.
Sourcepub fn layout_desc(self) -> PipelineLayoutDesc
pub fn layout_desc(self) -> PipelineLayoutDesc
This pipeline’s shape as the downlevel lint reads it, so the
bind-group, vertex-topology and sample-count ceilings
(frust_gpu::lint::lint_pipeline_layout) are checked against the real
descriptions rather than restated by hand.
Trait Implementations§
Source§impl Clone for EnginePipeline
impl Clone for EnginePipeline
impl Copy for EnginePipeline
Source§impl Debug for EnginePipeline
impl Debug for EnginePipeline
impl Eq for EnginePipeline
Source§impl Hash for EnginePipeline
impl Hash for EnginePipeline
Source§impl PartialEq for EnginePipeline
impl PartialEq for EnginePipeline
impl StructuralPartialEq for EnginePipeline
Auto Trait Implementations§
impl Freeze for EnginePipeline
impl RefUnwindSafe for EnginePipeline
impl Send for EnginePipeline
impl Sync for EnginePipeline
impl Unpin for EnginePipeline
impl UnsafeUnpin for EnginePipeline
impl UnwindSafe for EnginePipeline
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.