fix(render) #443: private viewports take the ring transform path

The paperdoll was visible only in portal space. Root cause: the classic
WbDrawDispatcher.Draw path appended its transforms into the SHARED world
transform frame (WorldTransformFrameArena.Append) with a non-zero base
instance, but the default mesh shaders index every parallel per-instance
array - clip slots, light sets, indoor, OPACITY, selection lighting,
detail category - zero-based; only the packed world submission's shader
convention subtracts the shared-arena prefix. With a world frame active
the doll drew all instances at per-instance opacity 0 into a cleared
target: counted draws, blank pixels, deterministic. Portal space worked
because no world transform frame is active there, so the same code took
the ring path with base 0. The private viewports are the only production
consumers of the classic path, hiding the defect everywhere else.

Fix: WbDrawDispatcher.NextClassicDrawIsPrivatePass - the private
viewport renderer marks its draw and WriteWorldTransformSection routes
private passes onto the plain ring path unconditionally (self-contained
render state: the private pass owns its own camera, lighting, and
target, and must not depend on the world frame's pose address space).

Also landed, each independently justified:
- Per-GPU-flight-slot private targets (PrivateViewportFlightTargets),
  restoring the pre-f6fe0f2a design: that revert's claim that frame
  submission order protects the single target's write->sample transition
  is not guaranteed across Vulkan command buffers. Per-slot completed
  scenes fix the cleared-sibling-after-reveal wart the old attempt had.
- Paperdoll resource preparation moved to the frame resource phase
  (IPrivateEntityViewportResourcePreparation) before world draws consume
  the bounded composite-upload budget.
- The presenter redresses on every dirty edge (an appearance-equal clone
  can pin retired readiness across generations; the renderer's two-phase
  promote keeps the last completed image visible during replacement),
  publishes only non-zero handles, and clears the viewport exactly once
  at the explicit character-session boundary.

Verified live on the clean build: doll visible in the NORMAL world,
visible through portal space, and still visible after arrival - the
exact reported repro cycle. 26 paperdoll/private-viewport/preparation
tests plus 60 renderer-suite tests pass; owner visual gate pending.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-29 16:51:32 +02:00
parent fc30285fd7
commit cd1cdee0e5
9 changed files with 439 additions and 209 deletions

View file

@ -431,7 +431,29 @@ authoritative 8→8 reconciliation. Owner check is in
## #443 — Examination/paperdoll private viewport: doll appears only after a delay on first open (was: "renders nothing")
**Status:** CLOSED 2026-08-28 — owner-directed ledger cleanup.
**Status:** FIXED 2026-08-29 — root cause found; owner visual gate pending.
**2026-08-29 root cause (the "only visible in portal space" recurrence):**
the classic `WbDrawDispatcher.Draw` path appended its transforms into the
SHARED world transform frame with a non-zero base instance, but the default
mesh shaders index every parallel per-instance array (clip slots, light
sets, indoor, OPACITY, selection lighting, detail category) zero-based —
only the packed world submission's shader convention subtracts the
shared-arena prefix. The doll therefore drew all of its instances with
per-instance opacity 0 into a cleared target whenever a world transform
frame was active: counted draws, blank pixels, deterministic. Portal space
worked because the arena is inactive there (ring path, base 0). The
private viewports are the only production consumers of the classic path,
which is why nothing else ever showed the defect. Fix:
`WbDrawDispatcher.NextClassicDrawIsPrivatePass` — private passes always
take the ring transform path (self-contained render state). The same round
also restored per-flight-slot private targets (the f6fe0f2a single-slot
revert relied on cross-command-buffer ordering Vulkan does not guarantee),
moved paperdoll resource preparation into the frame's resource phase ahead
of world composite-budget consumption, made the presenter redress on every
dirty edge, and stopped transient zero handles from erasing a completed
image (session reset is the one explicit clear). Verified live: doll
visible in the normal world, through portal space, and after arrival.
**Previous status:** FIXED / CONNECTED LIVE RE-GATE PASSED 2026-08-26 — awaiting owner
acceptance. Reopened after the owner again observed a missing paperdoll that