fix(render): restore retail per-cell alpha order
Reconstruct one combined static/dynamic object-part stream for each ordinary outdoor or interior cell, compute authored SortCenter CYpt keys, and stable-sort far to near before projecting opaque and delayed subsets. Prepare real cell-particle records at the leaf, preserve every S4-c2 router outcome, and merge object and particle delayed records by retained key before either source appends to the unchanged CLIP/ALPHA FIFO lists. Cell turns remain cell-major; equal cross-source ties are deterministically object-first. File AP-241 and AP-242 for the remaining separate opaque/row-5 channels and unrepresented equal-key common ordinal. File AP-243 for the paired-binary correction: retail shares the cell CYpt/heading beyond 50 m while this bounded port always uses the more exact authored per-part center. Pin 162 active AP rows and correct world-alpha and AlphaFlushCounts prose. Lead-approved scope clarification: RetailPViewPassExecutor.WalkLeaf.cs and RetailPViewPassExecutor.cs are the minimum existing production leaf adapter and thin particle-prepare forwarder omitted by the literal Walk/Wb file list. They contain no router, queue, mask, state, depth, or flush behavior; relocating them would create an artificial seam. Gates: Release solution build 0W/0E; shader/manifest 32/32; focused production 210/210; real allocation 3/3 at 0 B; one-shot hermetic 16743/0/0 across 14 assemblies; InstalledDat 385 pass/10 documented fail/1 skip with all six AlphaFlushSites passing; git diff --check PASS. Initial no-restore solution build failed NETSDK1004 for 42 missing scratch assets; one solution restore preceded the official build. Mutation proof, each restored before final gates: 1. Reverse comparator: authored-center order expected [202,101], actual [101,202]. 2. Move ties left: multipart/subset order expected [11,12,21,22], actual [22,21,12,11]. 3. Restore static/dynamic blocks: expected [2,3,1], actual [3,1,2]. 4. Use entity origin: authored-center order expected [202,101], actual [101,202]. 5. Restore particle tail: expected [Wb,Particle,Wb,Particle], actual [Wb,Wb,Particle,Particle]. 6. Scope-global sort: first cell model X expected 5, actual 50. 7. Restore dead camera parameter: SubmitWalkAlphaInstance parameter count expected 2, actual 3. 8. Restore stale global-queue prose: exact Assert.DoesNotContain failure on distance-sorts one shared queue. 9. Remove AP-241 identity: Assert.Single found no matching row. 10. Allocate in real merge: expected 0 B, actual 3072 B. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
06b986622b
commit
a86ec73ece
17 changed files with 1067 additions and 197 deletions
|
|
@ -47,9 +47,12 @@ namespace AcDream.App.Rendering.Wb;
|
|||
/// <c>DrawElementsIndirectCommand</c>. Per-frame ring allocations carry instance
|
||||
/// matrices (binding 0), per-group batch metadata/texture-table slots (binding
|
||||
/// 1), and the indirect draw commands. Opaque world groups remain MDI-batched.
|
||||
/// Transparent world instances enter <see cref="RetailAlphaQueue"/> so ordinary
|
||||
/// GfxObj parts and particles share retail's stable far-to-near stream; sealed
|
||||
/// off-screen consumers retain the immediate transparent MDI path.
|
||||
/// Transparent world instances enter <see cref="RetailAlphaQueue"/> after
|
||||
/// <c>WalkFrameDriver</c> reconstructs retail's stable far-to-near order
|
||||
/// independently for each object-cell turn from authored part SortCenter.
|
||||
/// Object and particle records are merged before they append to retail's two
|
||||
/// FIFO lists; sealed off-screen consumers retain the immediate transparent
|
||||
/// MDI path.
|
||||
/// </para>
|
||||
///
|
||||
/// <para>
|
||||
|
|
@ -2419,14 +2422,11 @@ public sealed partial class WbDrawDispatcher : IDisposable
|
|||
throw new InvalidOperationException(
|
||||
"One retail alpha scope cannot combine different view-projection matrices.");
|
||||
|
||||
// Retail CShadowPart::insertion_sort (0x006B5130) is stable:
|
||||
// equal-CYpt parts keep the order in which the cell submitted them.
|
||||
// Material grouping is an acdream batching detail and must not become
|
||||
// that tiebreak. Reconstruct the original draw-local instance order
|
||||
// before handing entries to the queue — S4-c2: retail's own queue is
|
||||
// FIFO (D3DPolyRender::AddMeshToAlphaList never sorts), so preserving
|
||||
// this walk-order sequence IS the ordering, not a sort key for a
|
||||
// later comparator.
|
||||
// a tiebreak. Reconstruct original draw-local submission order before
|
||||
// handing entries to retail's FIFO queue. The normal-world walk path
|
||||
// does not use this grouped route: WalkStaticStreamPopulator performs
|
||||
// the per-cell stable CYpt sort before its per-instance submissions.
|
||||
_alphaFingerprintScratch.Clear();
|
||||
foreach (InstanceGroup group in _translucentDraws)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue