pub struct DrawRunNode {
pub phase: PrimitivePhase,
pub command: Option<DrawCommandId>,
pub primitives: Rc<Vec<DrawPrimitive>>,
pub summary: DrawRunSummary,
pub replay: Option<Box<CommandReplayFrame>>,
}Fields§
§phase: PrimitivePhase§command: Option<DrawCommandId>Which draw command recorded these primitives. None only for runs
with no per-command provenance (hand-built tests).
primitives: Rc<Vec<DrawPrimitive>>Shared, not owned: the recording registry keyed by DrawCommandId
keeps a handle to the same buffer, so its capacity survives this
node being dropped on the next rebuild and the command re-records
into it instead of growing a fresh vector. Nothing mutates a run’s
primitives after construction, which is what makes sharing sound.
summary: DrawRunSummaryContent facts consumers keep asking per frame, answered once at construction. Surface planning used to rescan every primitive of every run per frame to learn “does it contain text?” — for a 17k-primitive game canvas with no text, that was two full walks per frame that could never early-exit.
replay: Option<Box<CommandReplayFrame>>The command’s verified retained/dynamic span structure for the frame
this node was built, in primitive space. A renderer that retains by
identity draws the run span by span — retained spans from slots
keyed (command, slot), dynamic spans from primitives — instead of
walking the whole vector. None means no verification ran or
nothing was retained: the run is all ordinary primitives.
Implementations§
Source§impl DrawRunNode
impl DrawRunNode
pub fn new(phase: PrimitivePhase, primitives: Vec<DrawPrimitive>) -> Self
pub fn for_command( phase: PrimitivePhase, command: Option<DrawCommandId>, primitives: Vec<DrawPrimitive>, ) -> Self
pub fn for_command_replayed( phase: PrimitivePhase, command: Option<DrawCommandId>, primitives: Rc<Vec<DrawPrimitive>>, replay: Option<Box<CommandReplayFrame>>, ) -> Self
Trait Implementations§
Source§impl Clone for DrawRunNode
impl Clone for DrawRunNode
Source§fn clone(&self) -> DrawRunNode
fn clone(&self) -> DrawRunNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more