cad-editor/src/shaders
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan 4b4f5c94cd perf(wire): switch wire pipeline to instanced rendering
Step 3 of the wire pipeline cold-open optimization plan — the biggest
single lever.

Each segment used to upload as 6 vertices × 96 B = 576 B with the segment
payload (pos_a/pos_b/color/half_width/distance/pattern_length/pat0/pat1)
duplicated across all six corners of the quad. Wire pipeline now uploads
one INSTANCE per segment (88 B) and the vertex shader derives `which_end`
and `side` from `@builtin(vertex_index)` against a 6-entry corner table.

Net effect on cold open: ~6.5× less wire vertex memory and PCIe upload,
plus a smaller Vec to allocate and copy on the CPU side.

Wire instance attributes also collapse distance_a / distance_b into a
single mix() inside the vertex shader, so per-segment distance still
interpolates correctly for the GPU-side linetype dash test.

Touches the wire, wire_xray, and face3d-edges draw passes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 09:52:23 +03:00
..
blit.wgsl fix: MSAA resolve no longer overwrites widget backgrounds 2026-04-08 12:20:47 +03:00
face3d.wgsl perf: dedicated Face3D shader — N draw calls → 2 2026-04-28 21:53:31 +03:00
hatch.wgsl fix(scene): hatch boundary + pattern precision for large-WCS drawings 2026-05-16 08:41:23 +03:00
hatch_batched.wgsl feat(pipeline): per-instance visibility for batched hatches (Phase 4-B, step 4) 2026-05-17 20:11:28 +03:00
image.wgsl feat: raster image render pipeline (IMAGE command + GPU textured quad) 2026-04-06 23:19:08 +03:00
mesh.wgsl first commit 2026-03-22 14:56:27 +03:00
viewcube.wgsl fix: ViewCube hover, glow, centroids, corner geometry and snap angles 2026-04-23 19:11:19 +03:00
viewcube_text.wgsl first commit 2026-03-22 14:56:27 +03:00
wire.wgsl perf(wire): switch wire pipeline to instanced rendering 2026-05-23 09:52:23 +03:00