GPU: match D3D12 copyable texture footprints #409
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!409
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/409/head"
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?
@ToxicmaggotRP on GitHub · 2026-11-24 03:00 UTC · original
ToxicmaggotRP:gpu/copyable-footprints-d3d12-layouts→main· +94 −23 · 1 files · 2 commits · closed without mergingTitle:
GPU: match D3D12 copyable texture footprints
Summary
Fixes #386.
GetCopyableFootprints.Regression coverage
The new test
copyable_footprints_match_native_packed_and_unaligned_casescovers:Verification status
main.cargo test -p victory-gpu: not yet run.cargo xtask policy: not yet run.AI-assisted contribution; testing and review are still required.
@zhouzhidong3-hash on GitHub · 2026-11-24 03:07 UTC · original · edited 2026-11-24 03:10 UTC
Independent RTX 5070 verification of #386 against this PR at
93991703e760add0247c00bf35583b790f7922e9. I reproduced the PR's new unit test failing on the unchanged head: format 68 mip 1 returns (6, 4), expected (6, 3).The packed element is 2 texels wide and 1 row tall. The changed width is also used to round the height, count rows, and calculate the byte span. For both DXGI 68 and 69, a 10×6 texture queried at mip 1 gives:
Native aligned upload/readback of synthetic patterns had zero mismatches for both packed formats and RGBA8. A negative control initializing only 10 of 12 payload bytes per packed mip row produced 6 mismatched bytes per format (2 per row × 3 rows); RGBA8 stayed clean.
With the incremental patch below,
cargo test --locked -p victory-gpureported 44 passed, 0 failed, 1 ignored. Separately the patched implementation matched 2,250 subresource records across 1,350 native GetCopyableFootprints queries, comparing offset, width, height, pitch, row count, row size, and total span. Matrix: formats 28/68/69/71/98, widths 8/12/260, heights 4/12/20, three mip levels, all contiguous mip ranges, and bases 0/1/511/512/513. Unaligned bases were queried only. Windows 10 19045, RTX 5070 driver 591.86, Rust 1.100.0 MSVC. No retail title or full-workspace test. AI-assisted by Codex.Incremental patch against this PR
Additional native D3D12 comparison on the same RTX 5070 and patched revision: 282 GetCopyableFootprints queries, 1,010 subresource records, all matched. I tested three-layer 2D arrays in DXGI formats 28, 68 and 69, plus a depth-five 3D texture in format 28. Each descriptor was 20 by 12 with three mips. I checked every contiguous subresource range at base offsets 0 and 513, comparing offsets, width, height, depth, row pitch, row count, row bytes and total bytes. This checks layout calculation only.
@ToxicmaggotRP on GitHub · 2026-11-24 03:16 UTC · original · edited 2026-11-24 03:18 UTC
Thanks for catching this. You're right: the original implementation incorrectly used the packed element width for both axes.
I've pushed the correction in commit
340499c44c7f52b47b856b2bd97dd7626a059b5d.The implementation now separates block width and block height. DXGI formats 68/69 use a 2-texel width and a 1-row height throughout allocation sizing, footprint span calculations, and subresource row counts.
The resulting
resource.rsblob matches the one in your incremental patch.Thank you for the independent RTX 5070 testing and the detailed native D3D12 comparison. Your report was extremely useful in finding this mistake.
@LocranKing on GitHub · 2026-11-24 03:22 UTC · original
Ran the pending checks on Windows 11 + NVIDIA GeForce RTX 3060 Ti (MSVC
1.98.1).Tested
340499c(pr-409, clean tree)32.0.16.2101), pinned Rust1.98.1(x86_64-pc-windows-msvc)cargo xtask policy:asset policy: 151 files okcargo test -p victory-gpu --lib: 44 passed, 0 failed, 1 ignored (resource::tests::copyable_footprints_match_native_packed_and_unaligned_cases ... ok; noteframe::tests::waits_end_on_ticks_and_count_framesflaked once under heavy background CPU load and passed cleanly when re-run normally)cargo test --workspace: 265 passed, 0 failed, 4 ignoredcargo build --profile diag -p victory --features diagnostics+ 35 s boot/menu run on RTX 3060 Ti (VICTORY_D3D12_DRED=1): presented 512+ frames (2551/2551draws,256/256dispatches), no crashes (crashes.logempty).Not tested: Entering gameplay/world beyond the start screens; standalone native
Verify-Footprints.ps1probe from #386.AI use: Antigravity (
Gemini 4 Hydrogen) ran the checks and drafted this comment from the command outputs.@broccolize on GitHub · 2026-11-24 03:39 UTC · original
Following up on #386, I verified
340499con Windows 11 build 26300.9974. NativeGetCopyableFootprintsreturned identical results on the GTX 1650, Intel UHD Graphics, and Microsoft WARP using synthetic textures.cargo test --locked -p victory-gpu --libon Rust 1.98.1 (x86_64-pc-windows-gnu) finished with 44 passed, 0 failed, and 1 ignored, including a pass for the footprint regression. The asset policy check passed for all 151 files.AI-assisted with Codex.
@dcastell1 on GitHub · 2026-11-24 09:48 UTC · original
Verified on native Windows, no Wine:
rust-toolchain.toml), MSVC 14.44.35207, debug build.main@8e79c80baseline on this box: 311 passed, 0 failed, 6 ignored (cargo test --workspace, exit 0).340499c4applied clean (patch -p1, no fuzz): 312 passed, 0 failed, 6 ignored, exit 0 — one more test than main, which is the footprint expectation, and nothing else changes verdict.So the new
upload_footprints_follow_the_pc_rulesexpectations hold on the same driver yuniskh reported (#386: 621.24, Windows 11 26300), which is the pair of inputs the issue table names — this is the suite side, not a freshGetCopyableFootprintscomparison.Tree restored afterwards (checksum against a clean checkout); no game data, the tests are synthetic.
AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@Marvisak on GitHub · 2026-11-25 00:31 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(4118f33b). Conflicting files:crates/victory-gpu/src/resource.rs.The content will be reviewed once the branch is rebased onto
main.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 20:15 UTC · original
I rebased both commits from
340499conto13f91cafor the conflict inresource.rs. The rebase keeps the depth/stencil plane handling from main and uses separate block widths and heights in the copy-row calculation added since the original base.Both commits retain @ToxicmaggotRP as the Git author. You can cherry-pick
98cef84followed by62f276a, or take the rebased branch. Please retain the original Git author if you take the commits.I ran the same synthetic queries against VIctory and native D3D12 on Windows WARP. Main differed on three out of five queries. With the rebase, every footprint field, row count, row size and total matched in all five.
RGBA8 with base offset 0 and all eight D24S8 plane entries with base offset 512 matched on both trees. The app-local WARP GPU suite passed 200 tests, including the extra comparison, with one ignored. Strict Clippy passed with default and all features. The repository asset policy passed. All test inputs were synthetic.
Pull request closed