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,12 +1676,18 @@ 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)
for pw in &self.gpu_preview_wires { // keeps them visible through any occluding geometry — a 3D solid, or
if pw.instance_count > 0 { // 2D geometry drawn in front — so a command preview is never hidden.
pass.set_vertex_buffer(0, pw.instance_buffer.slice(..)); // No scissor.
pass.draw(0..6, 0..pw.instance_count); 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);
}
} }
} }
} }