pub struct StencilFrameState {
pub cleared: bool,
pub next_ref: u32,
}Expand description
Per-frame stencil state (global clear + reference value per layer).
§Examples
use ailloli_ui_render_wgpu::stencil::StencilFrameState;
let state = StencilFrameState::default();
assert_eq!((state.cleared, state.next_ref), (false, 0));Fields§
§cleared: boolWhether the attachment has been cleared during this reference cycle.
next_ref: u32Last stencil reference allocated, in the range 0..=255.
Implementations§
Source§impl StencilFrameState
impl StencilFrameState
Sourcepub fn begin_layer(&mut self) -> (LoadOp<u32>, u32)
pub fn begin_layer(&mut self) -> (LoadOp<u32>, u32)
Allocates the next nonzero eight-bit reference and required load op.
The first layer clears to zero and returns reference 1. Subsequent layers load and increment through 255. The next request clears again and wraps to reference 1.
§Examples
use ailloli_ui_render_wgpu::stencil::StencilFrameState;
let mut state = StencilFrameState::default();
let (load, reference) = state.begin_layer();
assert!(matches!(load, wgpu::LoadOp::Clear(0)));
assert_eq!(reference, 1);Trait Implementations§
Source§impl Debug for StencilFrameState
impl Debug for StencilFrameState
Source§impl Default for StencilFrameState
impl Default for StencilFrameState
Source§fn default() -> StencilFrameState
fn default() -> StencilFrameState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StencilFrameState
impl RefUnwindSafe for StencilFrameState
impl Send for StencilFrameState
impl Sync for StencilFrameState
impl Unpin for StencilFrameState
impl UnwindSafe for StencilFrameState
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().