pub(super) enum ShapePlan {
Identity,
Shared {
shapes: Vec<usize>,
rows: Vec<PlannedRow>,
},
}Expand description
Which shapes get their vertices written, and how each mesh row reaches one.
Identity carries NO data on purpose: its plan is a function of the mesh
index alone, so materializing it would allocate ~80 bytes per mesh — on
every streamed batch of a writer that shares nothing — to store i and
nine repeated constants.
Variants§
Identity
The -parquet-v8 layout: every mesh writes its own geometry. What the
streaming route uses unless the client opted in to cross-batch sharing.
The -parquet-v9 layout.
Implementations§
Source§impl ShapePlan
impl ShapePlan
Plan a whole model (the buffered route) in the SAME two-stage order
/optimized uses (issue #5130): the rotation-aware collator
(collate_rotation_aware_placements) runs first, and every
occurrence it did not place falls through to a content hash of its
(origin-relative) vertex and index buffers (mesh_geometry_key), so
bit-identical occurrences the collator has no group for still collapse
onto one shape.
Stage 1 reuses the collator verbatim — the same grouping, the same
per-vertex residual check, the same all-or-nothing per group — so the
flat route can never share a shape the /optimized route would have
refused to share. Stage 2 mirrors serialize_to_parquet_optimized’s
None branch: the hash’s first occurrence (by mesh index, not by slot)
becomes the shared shape every later bit-identical occurrence points at.
Returns ShapePlan::Identity only when NEITHER stage shared anything
— a hash-only match must still return Shared, not just a collator
match — so a model with no repeats at all emits the v5 layout through
the same path it always did rather than through a Shared plan that
happens to be one-to-one.
Plan one stream batch against the shapes earlier batches emitted
(#5407). Everything Self::shared_shapes shares inside the batch is
still shared; on top of that, a shape whose content hash matches one
in prior is not written again — the row carries the earlier block’s
whole-stream range instead.
Stage 1 reaches across batches the same way: every retained template whose representation occurs in this batch is put in FRONT of it for the collator, which takes a group’s first member as its template, so this batch’s occurrences are verified against the very geometry an earlier batch emitted and placed on its block.
Also returns every shape this batch DOES emit, in emission order, with its content hash, so the caller can record where each one lands without hashing its geometry a second time.
baked_basis is the stream’s frame, which the pipeline publishes
before its first batch; None costs a site-rotated model its rotated
sharing (#4118), never correctness.
Sourcepub(super) fn shape_meshes<'a>(
&self,
meshes: &'a [MeshData],
) -> Vec<&'a MeshData>
pub(super) fn shape_meshes<'a>( &self, meshes: &'a [MeshData], ) -> Vec<&'a MeshData>
The meshes whose geometry is emitted, in emission order.
Auto Trait Implementations§
impl Freeze for ShapePlan
impl RefUnwindSafe for ShapePlan
impl Send for ShapePlan
impl Sync for ShapePlan
impl Unpin for ShapePlan
impl UnwindSafe for ShapePlan
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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<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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.