fix(wipeout): frame draws above the mask; mask joins the draw order

The wipeout pass ran after the wire pass with no draw-order bias, so
the mask erased its own boundary frame (and everything else at its
plane regardless of draw order). The mask uniform now carries the
entity's draw-order depth (uniform grows 80 → 96 bytes) and biases its
clip-z like every other pipeline, and the frame wire rides a
+half-rank override — the later mask pass fails the depth test at the
frame's pixels, so the boundary stays visible, while entities drawn
above the wipeout are no longer erased.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-23 07:23:10 +03:00
commit fd2607452d
4 changed files with 27 additions and 3 deletions

View file

@ -47,7 +47,7 @@ impl HatchVertex {
// ── Uniform structs ───────────────────────────────────────────────────────
/// Per-hatch parameters (binding 0). Must be 80 bytes (16-byte aligned).
/// Per-hatch parameters (binding 0). Must be 96 bytes (16-byte aligned).
///
/// `mode` encoding:
/// 0 → Pattern (families in FamilyBatchData)
@ -75,7 +75,9 @@ pub struct HatchUniformData {
// // is small (e.g. UTM drawing + sub-mm hatch).
pub origin_low: [f32; 2], // 72: anchor low residual (double-single) so the
// // vertex clip position stays precise at UTM scale.
} // total 80 bytes
pub draw_depth: f32, // 80: signed (-1,1) draw-order bias
pub _pad: [f32; 3], // 84..96
} // total 96 bytes
/// Boundary polygon (binding 1). Matches WGSL `Boundary`.
#[repr(C)]
@ -298,6 +300,8 @@ impl WipeoutGpu {
(origin[0] - origin[0] as f32 as f64) as f32,
(origin[1] - origin[1] as f32 as f64) as f32,
],
draw_depth: model.draw_depth,
_pad: [0.0; 3],
};
// ── BoundaryData (in snapped-local space) ────────────────────────