Skip to main content

ModelHistory

Struct ModelHistory 

Source
pub struct ModelHistory { /* private fields */ }
Expand description

Per-record previous-frame-transform validity for the GPU-filled model history ring.

Implementations§

Source§

impl ModelHistory

Source

pub fn new() -> Self

An empty tracker; Self::reset sizes it to the world.

Source

pub fn reset(&mut self, n_cull: usize)

Size the tracker to a world of n_cull records and invalidate every one: the history ring’s buffers have just been (re)allocated, so nothing in them was written for these records. Occupant generations survive, so a slot reused across the rebuild still reads as changed.

Source

pub fn begin(&mut self, mode: HistoryMode, n_cull: usize)

Open a draw-args build over n_cull records. Call once per build, before any of the flag queries; a Track build in steady state is a no-op.

Source

pub fn draw_flags(&mut self, record: usize, draw_idx: usize) -> u32

The GpuDrawArgs::flags bits cull record record needs for the draw slot draw_idx now filling it: NO_HISTORY when the ring’s entry was written for a different occupant, nothing when it can be trusted. Call exactly once per record per build.

Source

pub fn skinned_flags(&mut self, record: usize, skinned_idx: usize) -> u32

Self::draw_flags for a record in the skinned tail.

Source

pub fn take_prime(&mut self) -> bool

Whether the ring’s slots must all be filled before this frame reads one. True once per Self::reset; the caller dispatches the history kernel into every slot on that frame instead of only its own.

Source

pub fn reoccupy_draw(&mut self, draw_idx: usize)

Note that draw slot draw_idx now holds a different object. Call wherever a slot is written for a new occupant – a reused or appended draw slot, a streamed chunk moving in, a spawned clone.

Source

pub fn reoccupy_skinned(&mut self, skinned_idx: usize)

Note that skinned instance skinned_idx now holds a different object, as a revealed instance-pool slot does.

Trait Implementations§

Source§

impl Debug for ModelHistory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelHistory

Source§

fn default() -> ModelHistory

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.