pub struct ExternalRuns { /* private fields */ }Expand description
The distinct external textures one frame draws with, in the order it first names them.
A frame’s instances are drawn in painter order, and the single external binding has to be re-set whenever that order crosses from one texture to another. Rather than carry the id on every instance, each encoded paint takes a slot — its index here — and the renderer’s pass segments carry that slot, so a run of instances sharing a texture is one segment and one bind-group set.
Filled while the frame’s paints are lowered and read while its passes are recorded; cleared and refilled per frame, never growing past the number of external textures a single frame draws.
Implementations§
Source§impl ExternalRuns
impl ExternalRuns
Sourcepub fn slot_of(&mut self, key: u64) -> Option<u32>
pub fn slot_of(&mut self, key: u64) -> Option<u32>
The slot key is drawn under, assigning one if this frame has not
named it yet.
A linear scan rather than a map: a frame draws a handful of external textures at most — the binding is re-set between runs, so a scene that interleaved hundreds would be paying far more for the pass breaks than for the lookup.
None once the slot numbering would leave u32, which no real frame
reaches; the paint is then left unresolved and its draws skipped, which
is the same answer an unbound texture gets.