attributesRebuilt — true when a VERTEX attribute was rebound via
setAttribute: the first-commit position grow-rebind, the first-commit color
install, a color rebind forced by a format mismatch (refreshMeshColors
returning false), or a normal/aScalar rebind (replaceVertexAttribute's
buffer-too-small case) — false otherwise, including a color REFRESH, which
writes into the already-bound buffer rather than rebinding it. The commit uses this to evict three's stale WebGPU
RenderObject cache after a vertex-attribute rebind (its cached vertexBuffers
keeps pointing at the OLD GPU buffer/pipeline otherwise) — the same contract the
points/lines/gsplats commits follow via invalidateRenderObjectFor. A pure slice
move rebinds nothing at all — the index is written into its existing buffer
(applyMeshIndices) — so it returns false and the commit skips the
eviction. The geometry is mutated in place, so no caller
needs it returned.
Update an existing mesh geometry in place for a new projection epoch.
On a pure slice move only the index buffer changes, which is the whole point of the no-compaction design: the vertex attribute buffers stay uploaded and untouched, and
drawElementssimply stops referencing the culled vertices.positionis re-uploaded on any of three conditions:input.positionChangedis set (adisplayDimschange, where the display-space projection is re-extracted); the geometry's last upload used a differentdisplayDimskey than this commit (keyChanged); or it covered a different vertex count than this commit (countChanged— the reveal-ladder case, where a later level's committed prefix grows). Bounds are recomputed whenever position is replaced, because re-uploading the buffer does not invalidate Three.js's cachedboundingBox/boundingSphere, whichfrustumCulledand the raycaster broad phase both consult — and the display-space AABB genuinely changes under an axis permutation. Skipping that recompute makes a permuted mesh vanish from the frustum test while still being "loaded", which is a confusing failure to debug.The
colorattribute is installed on the first commit, then kept current with an in-place write on every commit that carries authored colors: the node is created with a 1-vertex placeholder color (seecreateEmptyMeshNode), so the authored colors have to be bound here or they would never reach the shader — and on a reveal ladder every later level's prefix has to reach the buffer too, or the vertices it reveals keep the zero-filled slot they were born with (#1522). See the guard below for the install-vs-refresh split.