RTX 5090 test: GetCopyableFootprints returns different row sizes and base offsets than native D3D12 #386

Open
opened 2026-11-26 04:02:05 +00:00 by github-bot · 5 comments
Owner

@⁠yuniskh on GitHub · 2026-11-24 02:51 UTC · original

While testing VIctory’s graphics on my RTX 5090, I found two texture layouts where the calculation in crates/victory-gpu/src/resource.rs disagrees with Windows Direct3D 12. I tested main at d2a4bae on Windows 11 build 26300.9974, NVIDIA driver 621.24.

Input VIctory calculation Native D3D12
10×6 texture, mip 1 (5×3), DXGI 68 or 69 5 texels in the footprint, 10 bytes per row 6 texels in the footprint, 12 bytes per row. These formats store two texels per four-byte word.
10×6 RGBA8, first two mips, base offset 1 Offsets 512 and 2048, total 2579 bytes Offsets 1 and 1537, total 2068 bytes. At base zero the offsets are 0 and 1536, and the total stays 2068.

Across 576 queries, the original calculation differed from native D3D12 in 402 cases. The revised calculation matched all 576. These were layout queries. I didn’t submit an unaligned GPU copy.

To reproduce, download the complete folder, extract the graphics-test ZIP inside, and run pwsh -NoProfile -File .\footprints\Verify-Footprints.ps1 in 64-bit PowerShell 7 on Windows. The recorded output is in footprints/results.txt. The ZIP includes the proposed patch and Rust regression tests.

The complete folder also contains the separate RTX 5090 and AMD Radeon pixel tests from PR #89. All 17 standalone programs passed locally. The patches applied to the tested main revision and PR #89 at 081afbd. I haven’t compiled the patched VIctory crate or tested GTA VI gameplay.

Download the complete outputs folder · RTX 5090 and AMD Radeon results on PR #89

AI-assisted with Codex.

**@⁠yuniskh** on GitHub · 2026-11-24 02:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/386) While testing VIctory’s graphics on my RTX 5090, I found two texture layouts where the calculation in `crates/victory-gpu/src/resource.rs` disagrees with Windows Direct3D 12. I tested main at `d2a4bae` on Windows 11 build 26300.9974, NVIDIA driver 621.24. | Input | VIctory calculation | Native D3D12 | | --- | --- | --- | | 10×6 texture, mip 1 (5×3), DXGI 68 or 69 | 5 texels in the footprint, 10 bytes per row | 6 texels in the footprint, 12 bytes per row. These formats store two texels per four-byte word. | | 10×6 RGBA8, first two mips, base offset 1 | Offsets 512 and 2048, total 2579 bytes | Offsets 1 and 1537, total 2068 bytes. At base zero the offsets are 0 and 1536, and the total stays 2068. | Across 576 queries, the original calculation differed from native D3D12 in 402 cases. The revised calculation matched all 576. These were layout queries. I didn’t submit an unaligned GPU copy. **To reproduce**, download the complete folder, extract the graphics-test ZIP inside, and run `pwsh -NoProfile -File .\footprints\Verify-Footprints.ps1` in 64-bit PowerShell 7 on Windows. The recorded output is in `footprints/results.txt`. The ZIP includes the proposed patch and Rust regression tests. The complete folder also contains the separate RTX 5090 and AMD Radeon pixel tests from PR #89. All 17 standalone programs passed locally. The patches applied to the tested main revision and PR #89 at `081afbd`. I haven’t compiled the patched VIctory crate or tested GTA VI gameplay. [Download the complete outputs folder](https://github.com/user-attachments/files/35308595/VIctory-complete-outputs.zip) · [RTX 5090 and AMD Radeon results on PR #89](https://git.gtahub.st/github/Marvisak--VIctory/pulls/89) AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:02:05 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 03:00 UTC · original

Independently applied the proposed VIctory-footprints.patch to main d2a4bae and ran it here (Arch, Wine 11.22 + vkd3d-proton 3.1, AMD RX 9060 XT/RADV):

  • The patch applies cleanly (only crates/victory-gpu/src/resource.rs, +58/−20).
  • Windows build of victory-gpu under Wine: 41 passed, 3 failed, 1 ignored. The three are the known environment failures (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, #128), and resource::tests::upload_footprints_follow_the_pc_rules passes with the patched expectations.
  • I also called the host's own GetCopyableFootprints for the two cases:
    • 10×6 RGBA8, 2 mips, base 1: offsets 1 and 1537, total 2068, row pitch 256; base 0 gives 0 and 1536, total 2068. That matches the native table in the report exactly.
    • DXGI 68/69 (5×3 mip 1): vkd3d-proton returns an invalid footprint (offset = UINT64_MAX, pitch/width/height = UINT32_MAX) for those formats, so this half cannot be checked against a host implementation here. The patched calculation gives width 6 and a 12-byte row size, which is the native value you recorded.

So the base-offset change is confirmed on a second host, and the 68/69 change matches the table but needs your Windows/pwsh result (or a Windows D3D12 host) for the host-side confirmation. No other test changes were needed.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 03:00 UTC · [original](https://github.com/Marvisak/VIctory/issues/386#issuecomment-7120679936) Independently applied the proposed `VIctory-footprints.patch` to `main` `d2a4bae` and ran it here (Arch, Wine 11.22 + vkd3d-proton 3.1, AMD RX 9060 XT/RADV): - The patch applies cleanly (only `crates/victory-gpu/src/resource.rs`, +58/−20). - Windows build of `victory-gpu` under Wine: **41 passed, 3 failed, 1 ignored**. The three are the known environment failures (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, #128), and `resource::tests::upload_footprints_follow_the_pc_rules` passes with the patched expectations. - I also called the host's own `GetCopyableFootprints` for the two cases: - **10×6 RGBA8, 2 mips, base 1**: offsets **1** and **1537**, total **2068**, row pitch 256; base 0 gives 0 and 1536, total 2068. That matches the native table in the report exactly. - **DXGI 68/69 (5×3 mip 1)**: vkd3d-proton returns an **invalid footprint** (`offset = UINT64_MAX`, pitch/width/height = `UINT32_MAX`) for those formats, so this half cannot be checked against a host implementation here. The patched calculation gives width **6** and a **12-byte** row size, which is the native value you recorded. So the base-offset change is confirmed on a second host, and the 68/69 change matches the table but needs your Windows/pwsh result (or a Windows D3D12 host) for the host-side confirmation. No other test changes were needed. No game data used.
Author
Owner

@⁠broccolize on GitHub · 2026-11-24 03:10 UTC · original

I’d like to take the native Windows verification for this issue and PR #409. I’ll check the packed DXGI formats and RGBA8 base offsets with synthetic textures, then run the Rust regression tests for the proposed fix.

**@⁠broccolize** on GitHub · 2026-11-24 03:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/386#issuecomment-7120836079) I’d like to take the native Windows verification for this issue and PR #409. I’ll check the packed DXGI formats and RGBA8 base offsets with synthetic textures, then run the Rust regression tests for the proposed fix.
Author
Owner

@⁠yuniskh on GitHub · 2026-11-24 03:12 UTC · original

Thanks for checking the base offset under Wine. For the native Windows comparison on the RTX 5090, the original bundle’s footprints/results.txt records a footprint width of 6 texels and a row size of 12 bytes for the 5×3 mip in both DXGI 68 and 69.

I ran a larger set of tests on the RTX 5090 (driver 621.24) and the integrated Radeon, using generated textures. Two results are relevant to the copy code:

  • NV12 and P010: Both GPUs matched the proposed two-plane layout across 608 native D3D12 queries, including 1080p arrays and 4K textures. All 115,554,960 active bytes matched after upload and readback.
  • Partial RGBA8 copies: I started with a known image and copied seven rectangles across five mip levels. Starting with a blank destination lost 1,496,221 untouched pixels. Uploading the starting image once preserved all 2,097,665 pixels on both GPUs. Uploading it again before every copy erased 535,250 pixels written by earlier copies.

All 48 packed-texture copy cases passed at 1440p and 4K. I also ran VIctory’s indirect-argument shader from d2a4bae through native D3D12. It passed 20 cases on each GPU. The separate blending test matched on the RTX 5090, but I still saw small differences on the Radeon under native D3D11.

The ZIP includes the runners, raw logs, two follow-up candidate patches, and Rust regression tests. All four patches applied together to d2a4bae. The patched Rust crate still needs a Windows build and test run. I haven’t tested GTA VI gameplay. Start with RESULTS.md for the commands and patch order.

AI-assisted with Codex.

VIctory-private-4K-tests.zip

**@⁠yuniskh** on GitHub · 2026-11-24 03:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/386#issuecomment-7120877314) Thanks for checking the base offset under Wine. For the native Windows comparison on the RTX 5090, the original bundle’s `footprints/results.txt` records a footprint width of 6 texels and a row size of 12 bytes for the 5×3 mip in both DXGI 68 and 69. I ran a larger set of tests on the RTX 5090 (driver 621.24) and the integrated Radeon, using generated textures. Two results are relevant to the copy code: - **NV12 and P010:** Both GPUs matched the proposed two-plane layout across 608 native D3D12 queries, including 1080p arrays and 4K textures. All 115,554,960 active bytes matched after upload and readback. - **Partial RGBA8 copies:** I started with a known image and copied seven rectangles across five mip levels. Starting with a blank destination lost 1,496,221 untouched pixels. Uploading the starting image once preserved all 2,097,665 pixels on both GPUs. Uploading it again before every copy erased 535,250 pixels written by earlier copies. All 48 packed-texture copy cases passed at 1440p and 4K. I also ran VIctory’s indirect-argument shader from `d2a4bae` through native D3D12. It passed 20 cases on each GPU. The separate blending test matched on the RTX 5090, but I still saw small differences on the Radeon under native D3D11. The ZIP includes the runners, raw logs, two follow-up candidate patches, and Rust regression tests. All four patches applied together to `d2a4bae`. The patched Rust crate still needs a Windows build and test run. I haven’t tested GTA VI gameplay. Start with `RESULTS.md` for the commands and patch order. AI-assisted with Codex. [VIctory-private-4K-tests.zip](https://github.com/user-attachments/files/35309271/VIctory-private-4K-tests.zip)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:47 UTC · original

Automated triage for the maintainers.

Both defects are present in main, in crates/victory-gpu/src/resource.rs:

  • Base offset: copyable_footprints places the first subresource at base.next_multiple_of(512) and reports the total as end - base, so a base of 1 gives offsets 512 and 2048 and a total of 2579 for the 10×6 RGBA8 two-mip case. The native values in the report (1 and 1537, total 2068) keep the base as given and align the later subresources relative to it.
  • Formats 68/69: element() lists them as 2 bytes per texel with a 1-texel block (48..=59 | 68 | 69 | ... => (2, 1)), so subresource gives a 5-texel, 10-byte row for a 5×3 mip. These formats pack two texels per 32-bit word, and native D3D12 rounds the width up to 6 texels and 12 bytes.

Open PR #409 addresses both (it currently carries triage: needs rebase).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/386#issuecomment-7149960198) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T03:12:45Z at=2026-11-25T01:50:40Z --> Automated triage for the maintainers. Both defects are present in `main`, in `crates/victory-gpu/src/resource.rs`: - **Base offset:** `copyable_footprints` places the first subresource at `base.next_multiple_of(512)` and reports the total as `end - base`, so a base of 1 gives offsets 512 and 2048 and a total of 2579 for the 10×6 RGBA8 two-mip case. The native values in the report (1 and 1537, total 2068) keep the base as given and align the later subresources relative to it. - **Formats 68/69:** `element()` lists them as 2 bytes per texel with a 1-texel block (`48..=59 | 68 | 69 | ... => (2, 1)`), so `subresource` gives a 5-texel, 10-byte row for a 5×3 mip. These formats pack two texels per 32-bit word, and native D3D12 rounds the width up to 6 texels and 12 bytes. Open PR #409 addresses both (it currently carries `triage: needs rebase`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 16:46 UTC · original

I reproduced the packed-format part of this report on main at 63bcca4 using WARP 1.0.22 and Agility SDK 1.620.2. For the 5×3 mip of the 10×6 texture, VIctory gave a footprint width of 5 and 10 bytes per row. Native D3D12 gives a width of 6 and 12 bytes per row.

4f1632d is a follow-up on top of #3287. It uses a four-byte horizontal pair for DXGI formats 68 and 69 in the footprint query. For both formats and both 10×6 and 12×6 base textures, mip 1 now matches native: footprint 6×3, 3 rows, 12 bytes per row, 256-byte row pitch, 524 total bytes. The 12×6 case checks a mip whose width is already even.

20 resource tests and the full GPU suite passed (248 passed, 1 ignored). Clippy passed with default features and all features, as did the asset policy check. These were layout queries on synthetic textures.

The commit credits @⁠ToxicmaggotRP for the original #409 work. If you take this into the existing PR, please retain the Git authorship and co-author trailer. If you squash it into another commit, please also add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 16:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/386#issuecomment-7198082577) I reproduced the packed-format part of this report on `main` at `63bcca4` using WARP 1.0.22 and Agility SDK 1.620.2. For the 5×3 mip of the 10×6 texture, VIctory gave a footprint width of 5 and 10 bytes per row. Native D3D12 gives a width of 6 and 12 bytes per row. [4f1632d](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/4f1632d054ceb09e60c1e22962e885f5e02fe457) is a follow-up on top of #3287. It uses a [four-byte horizontal pair](https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) for DXGI formats 68 and 69 in the footprint query. For both formats and both 10×6 and 12×6 base textures, mip 1 now matches native: footprint 6×3, 3 rows, 12 bytes per row, 256-byte row pitch, 524 total bytes. The 12×6 case checks a mip whose width is already even. 20 resource tests and the full GPU suite passed (248 passed, 1 ignored). Clippy passed with default features and all features, as did the asset policy check. These were layout queries on synthetic textures. The commit credits @⁠ToxicmaggotRP for the original #409 work. If you take this into the existing PR, please retain the Git authorship and co-author trailer. If you squash it into another commit, please also add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#386
No description provided.