cad-editor/src/scene/pipeline
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
..
face3d_gpu.rs fix(render): draw 3D surface fills at their real depth, not draw order 2026-07-02 01:23:27 +03:00
hatch_gpu.rs feat(web): render hatches on WebGL2 via a texture-backed renderer 2026-07-14 00:53:51 +03:00
hatch_web_gpu.rs feat(web): render hatches on WebGL2 via a texture-backed renderer 2026-07-14 00:53:51 +03:00
image_gpu.rs feat(render): double-single corners for the image pipeline 2026-06-23 18:28:52 +03:00
mesh_gpu.rs feat(render): draw ACIS solids as B-rep feature edges, meshes as tri edges 2026-07-04 17:57:00 +03:00
mod.rs perf(render): split the wire arena into regular + mesh-edge batches 2026-07-15 09:48:20 +03:00
text_gpu.rs fix(text): show text in command previews (move/copy/etc) (#316) 2026-07-10 10:49:13 +03:00
uniforms.rs refactor: remove the legacy full view_proj (CPU cull now relative-to-eye) 2026-06-24 20:14:41 +03:00
viewcube.rs refactor(viewcube): shrink cube 30%, compact controls, centre UCS picker 2026-06-27 01:56:17 +03:00
wipeout_gpu.rs refactor(pipeline): name the real hatch renderer hatch_gpu, legacy → wipeout_gpu 2026-07-09 10:45:40 +03:00
wire_arena.rs perf(render): split the wire arena into regular + mesh-edge batches 2026-07-15 09:48:20 +03:00
wire_gpu.rs perf(render): in-place GPU wire arena for move/edit (phase 4, OCS_WIRE_GPU_PATCH) 2026-07-15 06:02:25 +03:00