cad-editor/src/scene
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 95ef3b3890 perf(render): split the wire arena into regular + mesh-edge batches
The single-batch arena required a set with no mesh/solid edges, so any drawing
with a 3D solid or mesh (this one: 1693 mesh-edge wires of 12200) disqualified the
WHOLE set — every edit fell back to build_wire_buffers re-uploading ~265 MB
(4.4M instances), stalling ~1s per edit on a shared-memory GPU.

Split the resident set into a regular-2D arena and a mesh-edge arena (the wires
that need the draw loops mesh-edge skip/black treatment), one WireArena each,
passed as &[&WireModel] subsets (no clone). Both patch incrementally; the mesh
arena carries is_3d_mesh_edge so the existing draw loop handles it. A changed
handle absent from an arenas subset is a no-op for it, so each edit touches only
the batch it belongs to. Result: the wire block drops from ~300ms + a 265 MB GPU
upload to ~2ms.

Two correctness points folded in from adversarial review:
- mesh-edge wires are stamped draw_depth 0 (matching WireGpu::from_run) so their
  hidden back edges dont peek through the shaded fill; the mesh arena also always
  bails on append (all its wires share depth 0, so relocation would reorder
  coincident edges).
- buffers are capped at wgpus 256 MB limit — a batch larger than one buffer
  returns None so the caller chunks it via the batched path (fixes a create_buffer
  panic on the 355 MB regular batch).

Still behind OCS_WIRE_GPU_PATCH (default off). OCS_PERF prints the per-edit wire
timing + outcome.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 09:48:20 +03:00
..
cache feat(properties): make the Hyperlink field editable 2026-07-12 23:24:34 +03:00
convert feat(annotative): scale text/dims/tables/blocks at the annotation scale + editable property pickers 2026-07-12 23:16:44 +03:00
model fix(precision): keep typed hatch boundaries exact in f64 (#311) 2026-07-11 21:55:10 +03:00
pick fix(stretch): free crossing-window corners from Ortho, draw filled marquee (#291) 2026-07-10 13:32:32 +03:00
pipeline perf(render): split the wire arena into regular + mesh-edge batches 2026-07-15 09:48:20 +03:00
text fix(text): grow the SDF glyph atlas instead of dropping glyphs (#347) 2026-07-12 11:36:33 +03:00
view perf(render): split the wire arena into regular + mesh-edge batches 2026-07-15 09:48:20 +03:00
annotative.rs feat(annotative): synthesize per-object contexts + editable UI 2026-07-13 22:38:29 +03:00
camera_ops.rs fix(dxf): stop writing a duplicate *Active viewport (#319) 2026-07-09 22:36:00 +03:00
entity.rs perf(scene): delta journal so edits touch only changed entities (phase 0-1) 2026-07-14 23:50:04 +03:00
group_layer.rs feat(ui): bulk layer on/off, lock, freeze, transparency + Ctrl+A (#236) 2026-07-03 16:06:10 +03:00
layout.rs feat(layout): reopen a drawing in the space it was saved in 2026-07-12 01:01:40 +03:00
mod.rs perf(scene): route hide / isolate-end / solid-register through bump_entities (phase 5) 2026-07-15 08:11:21 +03:00
modify.rs perf(scene): delta journal so edits touch only changed entities (phase 0-1) 2026-07-14 23:50:04 +03:00
mspace.rs feat(nav): turntable orbit, selection/cursor pivot, Shift+MMB rotate (#229) 2026-07-01 21:58:04 +03:00
page_setup.rs fix(io): resolve root named-objects dict robustly on foreign DWGs 2026-07-13 16:28:21 +03:00
paper.rs perf(render): unify model/paper/block spaces on one resident wire path 2026-07-14 20:50:37 +03:00
preview.rs fix(stretch): free crossing-window corners from Ortho, draw filled marquee (#291) 2026-07-10 13:32:32 +03:00
project.rs refactor: split four oversized files into submodule trees 2026-06-26 22:51:29 +03:00
selection.rs perf(scene): delta journal so edits touch only changed entities (phase 0-1) 2026-07-14 23:50:04 +03:00