#13869·cesium

BufferPrimitiveCollection: collection.sort() invalidates vertex array buffers

Author: donmccurdyCreated Sep 30, 2026Updated Sep 30, 2026
Labelstype - bugneeds triage

What happened?

Flagged by Copilot in #13511 —

After an already-rendered 8–32-bit point collection is sorted, sort() replaces _positionView, while renderContext.attributeArrays.position still references the old array. This method writes only the replacement view, and the geometry-only renderer later uploads the stale cached array, so bulk position updates after sorting do not reach the GPU. Rebind the cached position array when buffers are replaced, or make the renderer upload from the current _positionView.

Reproduction steps

  1. Create a BufferPointCollection or BufferPolygonCollection using 16- or 32-bit positions.
  2. Render the collection at least once.
  3. Sort the collection
  4. Update some of the vertex positions
  5. Observe that rendering doesn't reflect the updated vertex positions

The bug likely doesn't affect BufferPolylineCollection, as it doesn't support the same optimization of copying directly the collection's position view.

Sandcastle example

No response

Environment

Browser: Any CesiumJS Version: v1.145 Operating System: Any

AI acknowledgment

  • I used AI to generate this issue report.
  • (If the above is checked) I have reviewed the AI-generated content before submitting.