Skip to content

Debug overlay renders nothing even on the indirect drawing path #243

Description

@schell

Debug overlay renders nothing even on the indirect drawing path

Repro

  1. Default headless Context (which selects the indirect/compute-culled drawing path — see the related flag-inversion issue).
  2. Build a scene (e.g. the manual's shadow-mapping scene: marble bust + ground plane + directional light + shadow map).
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions