pub enum DrawOrder {
Before,
Sorted(f32),
After,
}Expand description
Where a draw sits in the composite of a pass’s scenes.
Scene::record runs a scene’s draws in the order they are listed and
reads none of this. Scene::record_composited groups the draws of all
of its scenes: the sequenced ones first in scene
order, then the sorted ones of every scene together,
ordered back-to-front by their depth, then the
trailing ones in scene order.
Variants§
Before
Draw in sequence, ahead of the sorted pool. The default: opaque geometry and anything whose listed order is its own business stays exactly where its scene put it.
Sorted(f32)
Join the pass’s depth-sorted pool at depth, measured along the
camera’s view axis — Camera::view_depth in unlit3d reports the
same quantity: positive into the screen, so the farthest draw sorts
first. The pool holds the sorted draws of every scene, which is what
lets blended geometry composite by depth instead of by which scene
recorded first. A NaN depth is ordered by f32::total_cmp,
which places it relative to the finite depths by the sign bit its
payload carries; the order is total, so it cannot poison the sort.
After
Draw in sequence, behind the sorted pool: UI and overlays that sit
above the sorted draws whatever their depth. Clipped draws belong
here too, where nothing unclipped follows them — see
DrawEntry::scissor.
Trait Implementations§
impl Copy for DrawOrder
impl StructuralPartialEq for DrawOrder
Auto Trait Implementations§
impl Forget for DrawOrder
impl Freeze for DrawOrder
impl RefUnwindSafe for DrawOrder
impl Send for DrawOrder
impl Sync for DrawOrder
impl Unpin for DrawOrder
impl UnsafeUnpin for DrawOrder
impl UnwindSafe for DrawOrder
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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