forked from 1b-agent/opencadstudio-upstream
Pipeline slots are addressed by list index, but the renderer drops off-canvas viewports from the list, so a slot can be reused by a different viewport across frames — e.g. when the first paper viewport scrolls off the canvas the second slides into its slot and inherits its stale, differently frustum-culled GPU buffers. The text upload is gated on a geometry-epoch change (unaffected by the index shift), so the survivor rendered the gone viewport's text and its own vanished. Give each viewport a stable identity, remember which one last used a slot, and reset all cache keys when the occupant changes so wires, text, hatches, meshes and Face3D re-upload for the new viewport. No cost in the steady state — the reset fires only when a viewport enters/leaves view. Co-Authored-By: Claude Opus 4.8 <[email protected]>