pub struct ModelHistory { /* private fields */ }Expand description
Per-record previous-frame-transform validity for the GPU-filled model history ring.
Implementations§
Source§impl ModelHistory
impl ModelHistory
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty tracker; Self::reset sizes it to the world.
Sourcepub fn reset(&mut self, n_cull: usize)
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.
Sourcepub fn begin(&mut self, mode: HistoryMode, n_cull: usize)
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.
Sourcepub fn draw_flags(&mut self, record: usize, draw_idx: usize) -> u32
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.
Sourcepub fn skinned_flags(&mut self, record: usize, skinned_idx: usize) -> u32
pub fn skinned_flags(&mut self, record: usize, skinned_idx: usize) -> u32
Self::draw_flags for a record in the skinned tail.
Sourcepub fn take_prime(&mut self) -> bool
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.
Sourcepub fn reoccupy_draw(&mut self, draw_idx: usize)
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.
Sourcepub fn reoccupy_skinned(&mut self, skinned_idx: usize)
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.