pub(crate) struct DepthBuffer {
data: Vec<u32>,
}Fields§
§data: Vec<u32>Stores the maximum draw ID for each depth bucket.
Implementations§
Source§impl DepthBuffer
impl DepthBuffer
pub(crate) fn new(buffer_width: u16) -> Self
Sourcepub(crate) fn for_each_unset_run(&self, span: Span, f: impl FnMut(Span))
pub(crate) fn for_each_unset_run(&self, span: Span, f: impl FnMut(Span))
Calls f for every subspan of span that is not covered by any entry in the
depth buffer.
Sourcepub(crate) fn for_each_unset_run_and_write(
&mut self,
bucket_range: BucketRange,
draw_id: u32,
f: impl FnMut(BucketRange),
)
pub(crate) fn for_each_unset_run_and_write( &mut self, bucket_range: BucketRange, draw_id: u32, f: impl FnMut(BucketRange), )
Calls f for every bucket run in bucket_range that is not covered by any
entry in the depth buffer, and then marks the newly covered buckets in the
depth buffer.
Sourcepub(crate) fn for_each_visible_run(
&self,
span: Span,
draw_id: u32,
f: impl FnMut(Span),
)
pub(crate) fn for_each_visible_run( &self, span: Span, draw_id: u32, f: impl FnMut(Span), )
Calls f for every subspan of span that should be considered as visible assuming the
given draw ID.
Sourcefn range(&self, span: Span) -> (usize, usize)
fn range(&self, span: Span) -> (usize, usize)
Returns the depth-bucket index range touched by span.
pub(crate) fn clear(&mut self)
fn mark(&mut self, range: Range<usize>, draw_id: u32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DepthBuffer
impl RefUnwindSafe for DepthBuffer
impl Send for DepthBuffer
impl Sync for DepthBuffer
impl Unpin for DepthBuffer
impl UnsafeUnpin for DepthBuffer
impl UnwindSafe for DepthBuffer
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