Revert "Campaign V slice V4a" - it lost world multisampling
This reverts ceec3bc4. Two independent reasons, either sufficient.
The rendering regression. The slice deleted TextRenderGlStateScope, which
saved GL_MULTISAMPLE and GL_SAMPLE_ALPHA_TO_COVERAGE on entry, disabled them
for the text pass, and restored them on exit (TextRenderGlStateScope.cs:111-112
and 153-154 at the parent commit). Its replacement bakes that state into the
text pipeline but nothing restores it, and GlGpuPassEncoder.Dispose does not
either. Every world renderer is still raw GL at this point in the campaign, so
from the first UI frame onward the world drew with multisampling disabled.
The offline pixel gate caught it: 1,791 of 563,200 compared pixels differed,
0.318% against a 0.001 threshold. The commit message attributed this to
wall-clock-driven ambient animation shifting phase, and committed through the
failure. That explanation does not survive its own control: capturing twice at
the reverted-to commit differs by 19 pixels and twice at the slice's own commit
by 8, while base-versus-head differs by 1,791 - a 224x gap that no shared-noise
source explains. An amplified difference image settles it visually: the changed
pixels are the silhouette edges of every tree, building and rock, with terrain
interiors, water and the entire UI untouched. That is the signature of losing
edge antialiasing, not of animated sprites.
This is the exact failure mode two existing memory notes already warn about -
a mid-frame renderer must set every GL state it uses rather than inherit it,
and issue #52's lesson that a rendering migration must audit per-pass GL state
before declaring itself done.
The scope. The brief was three small leaf renderers plus additive frame-
lifecycle wiring, roughly ten files. The commit changed 334 files with 3,665
insertions and 3,845 deletions, including 323 public-to-internal visibility
conversions across the App assembly, 55 test files, two retired conformance
tests, and a self-described temporary escape hatch for bridging raw-GL viewport
textures. Even without the regression, that is not separable into the part
worth keeping and the part worth dropping.
Reverting rather than patching because the good work here - the RHI frame
lifecycle wiring and a genuine render-state-cache staleness fix - is small
enough to redo cleanly against a tightened spec, while untangling it from 300+
files of unrelated churn is not.
Post-revert: Release build clean, App suite back to 3,843 passed / 3 skipped,
offline pixel gate passing at 19 differing pixels.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ceec3bc440
commit
9aaf97e785
334 changed files with 3841 additions and 3661 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using AcDream.Core.World;
|
||||
|
||||
|
|
@ -8,27 +8,27 @@ namespace AcDream.App.Rendering;
|
|||
/// Splits a frame's landblock entities into the draw buckets used by the
|
||||
/// retail-style DrawInside flood.
|
||||
///
|
||||
/// <para>T1 (fused BR-2/3, 2026-06-11) — retail draw-order contract: the
|
||||
/// <para>T1 (fused BR-2/3, 2026-06-11) — retail draw-order contract: the
|
||||
/// frame draws STATIC world first (terrain, building shells, scenery, then
|
||||
/// flooded interior cells + their static object lists), and every DYNAMIC
|
||||
/// (server-spawned: player, NPCs, doors, items) draws LAST, depth-tested,
|
||||
/// never hard-clipped. This is what makes the aperture depth punch safe —
|
||||
/// never hard-clipped. This is what makes the aperture depth punch safe —
|
||||
/// when the punch erases depth inside a doorway, no dynamic has been drawn
|
||||
/// yet, so nothing visible is destroyed (retail: objects draw per cell AFTER
|
||||
/// cells, PView::DrawCells epilogue Ghidra 0x005a4840; the first BR-2 attempt
|
||||
/// punched after dynamics and erased the player, reverted 88be519).</para>
|
||||
///
|
||||
/// <list type="bullet">
|
||||
/// <item><see cref="Result.ByCell"/> — indoor STATICS (dat-baked, ServerGuid==0)
|
||||
/// <item><see cref="Result.ByCell"/> — indoor STATICS (dat-baked, ServerGuid==0)
|
||||
/// per visible cell, drawn with their cell.</item>
|
||||
/// <item><see cref="Result.OutdoorStatic"/> — outdoor statics (building
|
||||
/// <item><see cref="Result.OutdoorStatic"/> — outdoor statics (building
|
||||
/// shells, scenery stabs), drawn with the world/landscape pass.</item>
|
||||
/// <item><see cref="Result.Dynamics"/> — ALL server-spawned entities
|
||||
/// <item><see cref="Result.Dynamics"/> — ALL server-spawned entities
|
||||
/// (ServerGuid != 0) regardless of cell, plus unresolved-cell live entities;
|
||||
/// drawn in the frame's single LAST entity pass.</item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
internal static class InteriorEntityPartition
|
||||
public static class InteriorEntityPartition
|
||||
{
|
||||
internal enum ProjectionClass : byte
|
||||
{
|
||||
|
|
@ -51,13 +51,13 @@ internal static class InteriorEntityPartition
|
|||
void AbortFrame();
|
||||
}
|
||||
|
||||
internal sealed class Result
|
||||
public sealed class Result
|
||||
{
|
||||
public Dictionary<uint, List<WorldEntity>> ByCell { get; } = new();
|
||||
public List<WorldEntity> OutdoorStatic { get; } = new();
|
||||
public List<WorldEntity> Dynamics { get; } = new();
|
||||
|
||||
// MP-Alloc: scratch for PruneEmptyCellBuckets — reused across frames
|
||||
// MP-Alloc: scratch for PruneEmptyCellBuckets — reused across frames
|
||||
// so pruning itself doesn't allocate.
|
||||
private readonly List<uint> _emptyCellScratch = new();
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ internal static class InteriorEntityPartition
|
|||
/// entries (either newly emptied, or a leftover key from a previous
|
||||
/// frame's visible-cell set that this frame never touched). Keeps
|
||||
/// ByCell.Count / .Keys bit-identical to the old always-fresh-
|
||||
/// Dictionary behavior — callers that inspect key presence/count
|
||||
/// Dictionary behavior — callers that inspect key presence/count
|
||||
/// directly (not just TryGetValue) must see exactly the cells that
|
||||
/// actually received at least one static this frame.
|
||||
/// </summary>
|
||||
|
|
@ -100,7 +100,7 @@ internal static class InteriorEntityPartition
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allocating overload — always returns a brand-new <see cref="Result"/>.
|
||||
/// Allocating overload — always returns a brand-new <see cref="Result"/>.
|
||||
/// Kept for tests and any one-shot caller; the per-frame render path
|
||||
/// uses the <see cref="Partition(Result, HashSet{uint}, IEnumerable{ValueTuple})"/>
|
||||
/// reuse overload instead (see <see cref="RetailPViewRenderer"/>).
|
||||
|
|
@ -121,7 +121,7 @@ internal static class InteriorEntityPartition
|
|||
/// in place (see <see cref="Result.ClearForReuse"/>) and refills it,
|
||||
/// reusing each cell's existing <c>List<WorldEntity></c> when the
|
||||
/// cell key survives from the previous frame instead of allocating a new
|
||||
/// one — the per-cell dictionary entries persist across frames (cleared,
|
||||
/// one — the per-cell dictionary entries persist across frames (cleared,
|
||||
/// never removed) since the visible-cell set is usually stable frame to
|
||||
/// frame. Identical partitioning output to the allocating overload; only
|
||||
/// the backing storage is reused.
|
||||
|
|
@ -141,7 +141,7 @@ internal static class InteriorEntityPartition
|
|||
if (e.MeshRefs.Count == 0) continue;
|
||||
|
||||
// Retail contract: every server-spawned entity is a DYNAMIC
|
||||
// and draws in the last pass — indoor, outdoor, or unresolved.
|
||||
// and draws in the last pass — indoor, outdoor, or unresolved.
|
||||
if (e.ServerGuid != 0)
|
||||
{
|
||||
result.Dynamics.Add(e);
|
||||
|
|
@ -237,7 +237,7 @@ internal static class InteriorEntityPartition
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>Shared indoor classification — keep DrawDynamicsLast, the
|
||||
/// <summary>Shared indoor classification — keep DrawDynamicsLast, the
|
||||
/// outside-stage assignment (#118), and the partition in lockstep.</summary>
|
||||
public static bool IsIndoorCellId(uint cellId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue