From 34e750407b763aa82f492d74489479770d0e3b51 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 26 Jun 2026 07:29:28 +0300 Subject: [PATCH] fix(render): draw command-preview wires always on top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/scene/pipeline/mod.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/scene/pipeline/mod.rs b/src/scene/pipeline/mod.rs index ebd8b95d..1c8fe9fb 100644 --- a/src/scene/pipeline/mod.rs +++ b/src/scene/pipeline/mod.rs @@ -1676,12 +1676,18 @@ impl Pipeline { if scissor_active { pass.set_scissor_rect(0, 0, vp.width, vp.height); } - // Live overlay wires (command preview / interim / grip drag) on top - // of the base pass, same pipeline + depth test. No scissor. - for pw in &self.gpu_preview_wires { - if pw.instance_count > 0 { - pass.set_vertex_buffer(0, pw.instance_buffer.slice(..)); - pass.draw(0..6, 0..pw.instance_count); + // Live overlay wires (command preview / interim / grip drag) always + // 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 { + if pw.instance_count > 0 { + pass.set_vertex_buffer(0, pw.instance_buffer.slice(..)); + pass.draw(0..6, 0..pw.instance_count); + } } } }