pub struct PipelineCache {Show 25 fields
pub rect: RenderPipeline,
pub stroke: RenderPipeline,
pub textured: RenderPipeline,
pub rounded_rect: RenderPipeline,
pub border_rounded_rect: RenderPipeline,
pub box_shadow: RenderPipeline,
pub ring_progress: RenderPipeline,
pub rect_passthrough_stencil: RenderPipeline,
pub stroke_passthrough_stencil: RenderPipeline,
pub textured_passthrough_stencil: RenderPipeline,
pub rounded_rect_passthrough_stencil: RenderPipeline,
pub border_rounded_rect_passthrough_stencil: RenderPipeline,
pub box_shadow_passthrough_stencil: RenderPipeline,
pub ring_progress_passthrough_stencil: RenderPipeline,
pub rounded_rect_stencil_mask: RenderPipeline,
pub rect_stencil: RenderPipeline,
pub stroke_stencil: RenderPipeline,
pub textured_stencil: RenderPipeline,
pub rounded_rect_stencil: RenderPipeline,
pub border_rounded_rect_stencil: RenderPipeline,
pub box_shadow_stencil: RenderPipeline,
pub ring_progress_stencil: RenderPipeline,
pub rounded_rect_stencil_edge: RenderPipeline,
pub clip_bind_group_layout: BindGroupLayout,
pub texture_bind_group_layout: BindGroupLayout,
}Expand description
Cached wgpu render pipelines and shared bind group layouts.
A cache is bound to one device and one color target format. It contains plain, stencil-compatible, stencil-tested, and mask/edge variants used by planned batches.
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::PipelineCache;
assert!(std::mem::size_of::<PipelineCache>() > 0);Fields§
§rect: RenderPipelineSolid rectangle pipeline without a stencil attachment.
stroke: RenderPipelinePolyline stroke pipeline without a stencil attachment.
textured: RenderPipelineSampled-texture pipeline without a stencil attachment.
rounded_rect: RenderPipelineAntialiased rounded-rectangle fill pipeline without stencil.
border_rounded_rect: RenderPipelineRounded-rectangle border pipeline without stencil.
box_shadow: RenderPipelineAnalytic box-shadow pipeline without stencil.
ring_progress: RenderPipelineAnalytic circular progress-ring pipeline without stencil.
rect_passthrough_stencil: RenderPipelinesingle-pass compositing: same as rect, but with a stencil-compatible depth_stencil
(compare=Always, op=Keep). Used inside a single RenderPass that has a
stencil attachment, for layers that are NOT in stencil mode.
stroke_passthrough_stencil: RenderPipelineStroke pipeline compatible with, but not constrained by, attached stencil.
textured_passthrough_stencil: RenderPipelineTextured pipeline compatible with, but not constrained by, attached stencil.
rounded_rect_passthrough_stencil: RenderPipelineRounded fill pipeline compatible with, but not constrained by, attached stencil.
border_rounded_rect_passthrough_stencil: RenderPipelineRounded border pipeline compatible with, but not constrained by, attached stencil.
box_shadow_passthrough_stencil: RenderPipelineBox-shadow pipeline compatible with, but not constrained by, attached stencil.
ring_progress_passthrough_stencil: RenderPipelineProgress-ring pipeline compatible with, but not constrained by, attached stencil.
rounded_rect_stencil_mask: RenderPipelineWrites only to the stencil buffer (rounded mask).
rect_stencil: RenderPipelineSolid rectangle pipeline restricted to the active stencil mask.
stroke_stencil: RenderPipelineStroke pipeline restricted to the active stencil mask.
textured_stencil: RenderPipelineTextured pipeline restricted to the active stencil mask.
rounded_rect_stencil: RenderPipelineRounded fill pipeline restricted to the active stencil mask.
border_rounded_rect_stencil: RenderPipelineRounded border pipeline restricted to the active stencil mask.
box_shadow_stencil: RenderPipelineBox-shadow pipeline restricted to the active stencil mask.
ring_progress_stencil: RenderPipelineProgress-ring pipeline restricted to the active stencil mask.
rounded_rect_stencil_edge: RenderPipelineAA edge band: stencil NotEqual + rounded clip_alpha outside the hard mask.
clip_bind_group_layout: BindGroupLayoutUniform-buffer layout used by all clip-aware pipelines.
texture_bind_group_layout: BindGroupLayoutSampled 2D texture and filtering-sampler layout used by textured pipelines.
Implementations§
Source§impl PipelineCache
impl PipelineCache
Sourcepub fn new(device: &Device, surface_format: TextureFormat) -> Self
pub fn new(device: &Device, surface_format: TextureFormat) -> Self
Compiles the complete renderer pipeline family for surface_format.
Every cached color pipeline is format-specific. A cache must therefore be rebuilt when the presentation format changes.
§Panics
May panic if wgpu validation rejects a shader, layout, or pipeline.
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::PipelineCache;
fn compile(device: &wgpu::Device) -> PipelineCache {
PipelineCache::new(device, wgpu::TextureFormat::Bgra8UnormSrgb)
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for PipelineCache
impl !RefUnwindSafe for PipelineCache
impl Send for PipelineCache
impl Sync for PipelineCache
impl Unpin for PipelineCache
impl !UnwindSafe for PipelineCache
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
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