fix(render): draw command-preview wires always on top

Preview / interim / grip-drag overlay wires were drawn in the main wire
pass with the depth-tested wire_pipeline (depth_compare=LessEqual), so a
live command preview could be hidden behind occluding geometry — a 3D
solid, or 2D geometry drawn in front of it.

Draw them with the existing wire_xray_pipeline instead (depth_compare=
Always, no depth write), the same always-on-top path selection highlights
already use. Previews are now never occluded, for every command.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-26 07:29:28 +03:00
commit 34e750407b

View file

@ -1676,8 +1676,13 @@ impl Pipeline {
if scissor_active { if scissor_active {
pass.set_scissor_rect(0, 0, vp.width, vp.height); pass.set_scissor_rect(0, 0, vp.width, vp.height);
} }
// Live overlay wires (command preview / interim / grip drag) on top // Live overlay wires (command preview / interim / grip drag) always
// of the base pass, same pipeline + depth test. No scissor. // on top: the xray pipeline (depth_compare=Always, no depth write)
// keeps them visible through any occluding geometry — a 3D solid, or
// 2D geometry drawn in front — so a command preview is never hidden.
// No scissor.
if self.gpu_preview_wires.iter().any(|pw| pw.instance_count > 0) {
pass.set_pipeline(&self.wire_xray_pipeline);
for pw in &self.gpu_preview_wires { for pw in &self.gpu_preview_wires {
if pw.instance_count > 0 { if pw.instance_count > 0 {
pass.set_vertex_buffer(0, pw.instance_buffer.slice(..)); pass.set_vertex_buffer(0, pw.instance_buffer.slice(..));
@ -1685,6 +1690,7 @@ impl Pipeline {
} }
} }
} }
}
// ── Pass 6: wipeout fills (drawn after wires to mask them) ──────── // ── Pass 6: wipeout fills (drawn after wires to mask them) ────────
if !self.gpu_wipeouts.is_empty() { if !self.gpu_wipeouts.is_empty() {