diag(render): Phase A8.F — portal-frame visual-gate triage apparatus

Env-gated diagnostics (off by default; do not affect the default game):
- ACDREAM_A8_DUMP_PV=1: PortalVisibilityBuilder dumps local→NDC→clipped portal
  geometry + OutsideView poly count for the first 2 Build calls per camera cell.
- ACDREAM_PROBE_ENVCELL=1: [opaque] line dumps the opaque cell-render stats
  (cells/tris) BEFORE the per-cell transparent loop overwrites _envCellRenderer.Stats.
Used to diagnose the A8.F visual-gate failure (see handoff doc). Gated behind
ACDREAM_A8_INDOOR_BRANCH=1 like the rest of the indoor branch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-29 14:40:23 +02:00
parent 452ee5b9a1
commit 7c3ee438bd
2 changed files with 42 additions and 0 deletions

View file

@ -11069,6 +11069,9 @@ public sealed class GameWindow : IDisposable
currentEnvCellIds.Add(id);
gl.Disable(EnableCap.Blend);
_envCellRenderer!.Render(AcDream.App.Rendering.Wb.WbRenderPass.Opaque, currentEnvCellIds);
// TEMP A8.F triage (strip after): opaque wall-render stats BEFORE the transparent loop overwrites them.
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeEnvCellEnabled && _a8OpaqueDumped.Add(cameraCell.CellId))
Console.WriteLine($"[opaque] camCell=0x{cameraCell.CellId:X8} cells={_envCellRenderer.Stats.CellsRendered} tris={_envCellRenderer.Stats.TrianglesDrawn} filterCnt={currentEnvCellIds.Count}");
// Phase A8.F (#2): translucent cell geometry clipped to each cell's portal-chain
// region (stencil BIT 2). Opaque cells already clip correctly via depth (left
@ -11378,6 +11381,9 @@ public sealed class GameWindow : IDisposable
private readonly HashSet<(uint cellId, ulong gfxObjId)> _phaseA8AuditLogged = new();
// TEMP A8.F triage (strip after): one-shot-per-camCell guard for the [opaque] wall-render probe.
private static readonly System.Collections.Generic.HashSet<uint> _a8OpaqueDumped = new();
private void EmitEnvCellProbe(int ourBldgs, int otherBldgs, int filterCnt)
{
if (!AcDream.Core.Rendering.RenderingDiagnostics.ProbeEnvCellEnabled) return;