Repository navigation
gpu: fix transient RT aliasing barriers, DiscardResource, and 64 KiB alignment - #1994
AndyLatimer wants to merge 1 commit into
Conversation
…alignment Addresses the barrier ordering, tile alignment, and hardware compression hazards introduced by physical-page transient RT aliasing (trustno1-coder#1976): - Enforce 64 KiB start alignment in `inplace::aliased_section_pages` so sub-64 KiB allocations never alias onto a live neighbor's final tile. - Track physical `(section, [start, end))` tile extents and retain Tier-2 heap refs on `AliasExtent`; verify resolved `GetDesc()` mip count and full `GetResourceTiling` subresource coverage before mapping, returning all aliased resources in `D3D12_RESOURCE_STATE_COMMON`. - Remove the blanket `prelude()` aliasing/transition batch that activated overlapping later-pass RTs before earlier passes finished. - Retire only genuinely overlapping active aliases to `COMMON` before emitting `Aliasing(None -> tex)` + `DiscardResource` on takeover, transitioning all aliased RTs back to `COMMON` at `HostList::close` and resolving cross-list takeovers (without discarding incremental continuation of the same RT) via submission-time `OWNERS` in `prelude()`. - Preserve the `transition_and_record` prior-state contract for `texture::alias` and update `two_queues::probe` for `StateBook`. Co-Authored-By: Antigravity <noreply@google.com>
…no1-coder#1958, trustno1-coder#1573, trustno1-coder#1994) Source: trustno1-coder/VIctory-NVIDIA pull requests. trustno1-coder#1793 texture-only change; retain local profile.
|
Tested this PR on hardware: the coloured blocky glass corruption from #2233 is still there with it. Build: v2026.11.29.01 ( System: RTX 3070 8 GB, driver 610.88, Windows 11 26200. Series S, DLSS Ultra Performance, FG off, RT off, warm cache. Result in the prologue window shot (the same frame every time):
So with this PR only about 100 targets alias, presumably because the 64 KiB start alignment rejects the rest. The pool then costs more than it saves on Series S, and the corruption remains. It seems to come from something other than the barrier/Discard ordering, such as reading another alias's pages with a different format through the undefined swizzle. For Series S, an opt-in default as in #2042 looks safer until this is understood. |
Fixes #1976
Summary
Fixes the physical-page transient RT aliasing hazards introduced in
6ba7fa8(stale tile compression/warm memory bleeding across passes, premature barriers inprelude(), and sub-64 KiB overlap):inplace::aliased_section_pages)start & 0xffff != 0instead of roundingstartdown, preventing tile 0 from aliasing onto an adjacent live resource's tail page.DiscardResourceordering (host.rs,alias_rt.rs,resource.rs)D3D12_RESOURCE_STATE_COMMONat creation (try_create) and across command list boundaries (HostList::aliased_rts_commonatHostList::close).if copy.aliased_rtaliasing & initial-transition loop fromHostList::prelude(), which previously activated overlapping later-pass targets before earlier passes finished reading the active alias.ListAliases) and physical(section, [start, end))tile extents (AliasExtent), retiring only genuinely overlapping active aliases toCOMMONbefore emittingAliasing(None -> tex)+DiscardResource(forALLOW_RENDER_TARGET/ALLOW_DEPTH_STENCIL) on takeover. Disjoint MRTs and same-aliasRT -> SRV -> RTtransitions do not trigger false retirement/discard.OWNERS) inprelude()so cross-list takeovers emitAliasing+DiscardResourcein exact queue submission order while incremental multi-list rendering of the same RT is preserved untouched.HostList::transition_and_record's prior-state return contract fortexture::aliasand updatetwo_queues::probeforStateBook.alias_rt.rs)texture.GetDesc()afterCreateReservedResource(handlesMipLevels == 0), verifynum_sub == subresource_count,NumStandardMips + NumPackedMips == mips, and full subresource tile coverage before mapping, retain strong Tier-2ID3D12Heaprefs insideAliasExtent, and retire removed section heaps asynchronously insection_gone.Verification
cargo test --release -p victory-gpu --locked --lib -- alias_rt inplace: 14 passed, 0 failed (unit tests for 64 KiB start alignment,ExtentRangescoalescing/overlap, intra-listListAliasesMRT/takeover tracking, cross-listOwnerTabletracking, and a real D3D12 Tier-2 reserved RT aliasing +DiscardResourcereadback test on RTX 3060 Ti).cargo clippy -p victory-gpu --all-targets --lockedand--all-features: 0 warnings/errors in all 6 modified files.cargo build --release -p victory --locked: passed (exit code 0).cargo test -p xtask --locked: 0 asset-policy issues in all 6 modified files (pre-existinglower.rssize violation onmainuntouched).