forked from 1b-agent/opencadstudio-upstream
refactor(pipeline): drop legacy per-hatch path (Phase 4-B, step 5)
The batched hatch pipeline has soaked through visibility + LOD; it's correct on every file tested (Floor plan.dxf, UTM site plans, the non-UTM regression case). Time to remove the parallel per-hatch plumbing that's been sitting empty since step 3: - `gpu_hatches: Vec<HatchGpu>` — never populated since `upload_hatches` switched to the batched builder; dropped. - `hatch_pixel_scissors`, `hatch_skip_flags` — same story; dropped. - `compute_hatch_scissors` — no longer has a consumer; dropped, with the render-time call removed from `Primitive::prepare`. - Hatch render pass — the dead `else if` branch over `gpu_hatches` is gone; only the single batched `pass.draw(0..vertex_count, 0..1)` remains. - `compute_hatch_lod` — no fallback path; if `gpu_hatch_batched` is `None` (empty hatch list) it just returns early. `HatchGpu` itself stays — the wipeout pipeline still uses it. So do `hatch_pipeline` / `hatch_bgl1`, kept around for that path. `#[allow(dead_code)]` on the four storage-buffer fields in `HatchBatchedGpu` — they exist only to keep the bind group's referenced resources alive; nothing reads them directly. Known gap left as a follow-up: per-hatch viewport scissor for paper- space MSPACE viewports isn't ported to the batched path yet. Hatches inside a paper-space viewport can render past the viewport border until that's added. Hasn't surfaced as a visible regression in the test files so far. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
398eee551d
commit
798a391207
3 files changed
+32
-95
No files matched your search
@@ -132,10 +132,14 @@ impl HatchBatchedVertex {
|
||||
pub struct HatchBatchedGpu {
|
||||
pub vertex_buffer: wgpu::Buffer,
|
||||
pub vertex_count: u32,
|
||||
pub instance_buffer: wgpu::Buffer,
|
||||
pub boundary_buffer: wgpu::Buffer,
|
||||
pub family_buffer: wgpu::Buffer,
|
||||
pub dash_buffer: wgpu::Buffer,
|
||||
// The four storage buffers below are referenced via `bind_group` —
|
||||
// dropping them would invalidate it, but the bind group is the
|
||||
// only direct consumer. Keep them as fields to keep ownership in
|
||||
// one place; `#[allow(dead_code)]` silences the read-never warning.
|
||||
#[allow(dead_code)] pub instance_buffer: wgpu::Buffer,
|
||||
#[allow(dead_code)] pub boundary_buffer: wgpu::Buffer,
|
||||
#[allow(dead_code)] pub family_buffer: wgpu::Buffer,
|
||||
#[allow(dead_code)] pub dash_buffer: wgpu::Buffer,
|
||||
/// Per-instance visibility flag (1=draw, 0=skip). Stored in its
|
||||
/// own small storage buffer so per-frame updates don't have to
|
||||
/// touch the large `instance_buffer`. Vertex shader reads
|
||||
@@ -144,7 +148,7 @@ pub struct HatchBatchedGpu {
|
||||
/// fragment stage runs.
|
||||
pub visibility_buffer: wgpu::Buffer,
|
||||
pub bind_group: wgpu::BindGroup,
|
||||
pub instance_count: u32,
|
||||
#[allow(dead_code)] pub instance_count: u32,
|
||||
/// CPU mirror — `update_visibility` re-uploads this whole slice
|
||||
/// when any flag changes. ~4 B per hatch, so 40 KB / 10 k hatches
|
||||
/// per pan tick. Far cheaper than touching the 112 B-per-instance
|
||||
|
||||
Reference in new issue
Block a user