Placed twins of another format family get their copy through a buffer… #3976
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3976"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Koaio on 2026-11-30T13:32:32Z.
…, not texture to texture (0x80070057 at list close)
The twins of a texture (
resource::placed_twins) are matched by block size, so a BC3 texture's twin can be BC7.copy_texture_regioncopied into every twin with the title's own locations, and D3D12 refuses a texture to texture (or footprint to texture) copy across families when the list closes: "a host command list did not close (0x80070057)". #3901 named those twin copies as the refused commands (BC3_UNORM_SRGB levels into a BC7_UNORM_SRGB twin) and showed the same bytes land bit for bit through a buffer.twin_copynow picks a route per twin:texture::aliasdoes), when both levels are laid out alike;Fixes #3923, #3928; refs #3901, #3880.
Fixes #
What it changes
How it was tested
cargo testpassed for the crates it touches: yes / noChecked for overlap
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T13:49:15Z.
I found a silent partial-copy case in the routing at
31f83baa. The primary copy can legally interpret a 4×4R32G32B32A32_TYPELESSfootprint as the 16 blocks of a 16×16 BC3 texture. When the twin is also BC3, the current branch changes the footprint to BC3 while leaving its dimensions at 4×4. D3D12 now reads one block instead of 16. Both commands close and execute successfully.I initialized the destination to zero, filled the source with a 256-byte pattern across all four rows, and read back the BC3 blocks. The original footprint and a direct raw texture source reproduced all 256 bytes. The retagged footprint only copied the first 16 bytes. This reproduced on RTX 4060 and WARP for BC3 typeless, UNORM and sRGB.
The tested follow-up uses the primary destination family for the original-copy path, as #3979 does, and keeps the buffer route for compatible cross-family layouts such as BC3/BC7. A footprint can only be retagged when both element size and block dimensions match. It also delays the write bookkeeping until a route will actually record a copy. Previously a skipped region or failed scratch allocation could still mark the twin as host-written and suppress a later upload.
The route regression and related list, resource and alias-copy tests passed on Windows with 59 passed and 1 ignored in both the native and WARP configurations. Gameplay and the reported cutscene crashes remain unverified by this synthetic test.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tillo88 on 2026-11-30T17:58:55Z.
I wanted to measure this against the 0x80070057 crash at the prison-to-plane cut (#2237), but it no longer merges: conflict with v2026.11.30.01 and with v2026.11.30.02 (GitHub shows it as conflicting with main too). I'll measure it if it is rebased.
Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-30T18:59:47Z.
Test report for this PR: the failure it targets is confirmed on WARP, and the PR routes every refused pair around it. The mission crash itself is not reproduced in game.
Setup: v2026.11.30.01 (
c71899d9) and v2026.11.30.02 (84bd61e2); RTX 5080, Series X profile, 2560x1440, DLSS off, frame generation off, ray tracing off. To get it onto current main I re-applied31f83baaon .01 and .02. Main now finds the twin's subresource withresource::host_target, so that lookup stays andtwin_copygets main'shost_sub. No other change.1. Mechanism, unit test on the software adapter (WARP). Each case records one copy into a fresh list, then calls
Close.Closewithout a checkThe middle column comes from the WARP tests. The right column is
twin_routechecked on each pair, plus each pair's through-buffer copy recorded and closed on WARP, in a test on the port. Your own two tests pass there too. The tests ran on the .02 port, because .01's own test build stops at host test calls that .02 fixed. The mechanism tests are on a branch: https://github.com/Lyrnc/VIctory-NVIDIA/commits/test/twin-copy-close-warp (list::twin_close_tests). The per-PR check is below; it goes in the same module.One review note, untested in game.
Retypedswaps in the twin's format and keeps the footprint's texel width and height. For BC3 to BC7 that is exact, since both use 16-byte 4x4 blocks. But a raw footprint of 16-byte texels (R32G32B32A32, one texel per block) into a BC3 destination whose twin is BC7 also counts as "another family" here. Retyped as BC7, it would cover 1/16 of the region. D3D12 accepts that raw copy as it is: an R32G32B32A32 footprint into a BC7 texture closes on WARP. So it may be worth takingRetypedonly when the source's block size matches the twin's, and letting the raw pairs D3D12 allows stayDirect. That only matters if the title makes such copies into twins, which I haven't seen.Per-PR check (passes on the port)
2. In game: the mission crash is not reproduced. The save attached to #3972 starts before the mission. Reaching the scene where it crashes means a long drive plus the first part of the mission, and #3890 says there is no save point after that part, so our scripted runs could not get there. I did about 25 min of free roam from that save on .01, outdoors and in a house interior. The build carried a local diagnostic log that names every copy D3D12 would refuse (title copies and placed-twin copies) and, when
Closefails, what that list held. Result: no refused twin copy and no failedClose. The cross-family twin path simply did not come up there, so it gives no before/after for this PR.Not covered by this PR (twins don't need it): a title copy whose own source and destination are of different families (#2914's
BC7_TYPELESS -> BC6H). #3043 goes at that one.Tested and written with Claude Code (AI).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:47:22Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed