Debug overlay renders nothing even on the indirect drawing path
Repro
- Default headless
Context (which selects the indirect/compute-culled drawing path — see the related flag-inversion issue).
- Build a scene (e.g. the manual's shadow-mapping scene: marble bust + ground plane + directional light + shadow map).
stage.set_use_debug_overlay(true), render, compare to the same render without the overlay.
Result: the output is byte-identical to the non-overlay render — 0 pixels differ. No bounding-volume outlines appear.
What it is not
Instrumentation confirmed the overlay render branch is entered
(has_debug_overlay=true, maybe_indirect_buffer=Some), the bindgroup is
created, and render_pass.draw(0..6, 0..1) executes on the full-screen quad.
So the failure is inside debug_overlay_fragment
(crates/renderling/src/debug.rs): every fragment ends up writing
Vec4::ZERO.
Suspects
- The
slab.read_unchecked(GeometryDescriptor::OFFSET_OF_CAMERA_ID) /
OFFSET_OF_RESOLUTION reads returning garbage (stale stage slab buffer in the
overlay bindgroup?)
project_onto_viewport math producing off-screen rectangles
- The
step_le(sphere_aabb.max.z, 1.0) alpha gate interacting badly with
reversed-depth rendering, zeroing alpha for visible objects
Also worth fixing
The overlay silently no-ops when there is no indirect draw buffer (direct
drawing) — if let Some(indirect_draw_buffer) = maybe_indirect_buffer in
Stage::render. A log::warn! there would save users a debugging session.
Context
Found while writing the debug-modes manual chapter (worktree
docs-missing-manual-buildout); the chapter documents set_use_debug_overlay
with a caveat and links this issue. The overlay test step was removed from the
example because the feature currently produces no visible output.
Debug overlay renders nothing even on the indirect drawing path
Repro
Context(which selects the indirect/compute-culled drawing path — see the related flag-inversion issue).stage.set_use_debug_overlay(true), render, compare to the same render without the overlay.Result: the output is byte-identical to the non-overlay render — 0 pixels differ. No bounding-volume outlines appear.
What it is not
Instrumentation confirmed the overlay render branch is entered
(
has_debug_overlay=true,maybe_indirect_buffer=Some), the bindgroup iscreated, and
render_pass.draw(0..6, 0..1)executes on the full-screen quad.So the failure is inside
debug_overlay_fragment(
crates/renderling/src/debug.rs): every fragment ends up writingVec4::ZERO.Suspects
slab.read_unchecked(GeometryDescriptor::OFFSET_OF_CAMERA_ID)/OFFSET_OF_RESOLUTIONreads returning garbage (stale stage slab buffer in theoverlay bindgroup?)
project_onto_viewportmath producing off-screen rectanglesstep_le(sphere_aabb.max.z, 1.0)alpha gate interacting badly withreversed-depth rendering, zeroing
alphafor visible objectsAlso worth fixing
The overlay silently no-ops when there is no indirect draw buffer (direct
drawing) —
if let Some(indirect_draw_buffer) = maybe_indirect_bufferinStage::render. Alog::warn!there would save users a debugging session.Context
Found while writing the debug-modes manual chapter (worktree
docs-missing-manual-buildout); the chapter documentsset_use_debug_overlaywith a caveat and links this issue. The overlay test step was removed from the
example because the feature currently produces no visible output.