Round-trip a six-level 64 KiB BC texture through XG and D3D12 #1300

Manually merged
github merged 1 commit from gh-pr/1300/head into gh-pr/1300/base 2026-11-26 22:56:12 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 07:18 UTC · original
R0Y00:codex/xg-six-levels → main · +420 −28 · 11 files · 1 commits · merged 2026-11-24 07:25 UTC

Refs #874.

The opt-in startup shim now carries one explicit guest layout through XG layout queries, copy in and out, and texture sampling. The supported shape is 1024×1024 with six BC5_UNORM or BC7_UNORM mips, one slice and sample, layout 0x109 (64 KiB standard, no XOR), default alignment and zero flags. Each of the three smallest levels lives within guest tile zero. The D3D12 upload stages each level using its desktop footprint. The same guest addressing rule is used by an address SRV and by the uploader for a resource placed at a title address. The automated GPU test exercises the address SRV path.

The reference six offsets and every visible 16-byte block address were compared offline with the Mesa 25.1.0 AMD addrlib at 5c142e46, using the existing Navi21 configuration. Independent checks of the per-level offsets and block addresses matched the implementation published at ivall/xcl revision 64b3f355. The regression runs on source-built data and needs neither reference tree at runtime.

Windows 11 build 26200.9974, x64 MSVC Release, NVIDIA RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Tested at 47e91d85.

cmake --build --preset release --target startup_stream_consumer
ctest --preset release --no-tests=error --output-on-failure -R '^startup_(xg_bc_chain_|xg_bc7_(layout|draw)|address_(bc_view|srv))'

Two new and seven existing cases passed, with zero skips. Each format/backend pair checked all 87,360 guest block locations, row and tile padding, an invalid subresource, size/offset/tile queries, and 12,288 GPU pixels. Forcing mip zero in the second half of the draw changed 5,120 of the 6,144 pixels in each pair, as expected. Running an independent uniquely tagged block fixture on the prior shim yielded zero correct guest positions in each copy direction.

The production evidence for this PR is limited to the software contract exercised by the source-built fixtures. This does not change DirectStorage or apply any file offset correction.

**@⁠R0Y00** on GitHub · 2026-11-24 07:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1300) `R0Y00:codex/xg-six-levels` → `main` · +420 −28 · 11 files · 1 commits · merged 2026-11-24 07:25 UTC Refs #874. The opt-in startup shim now carries one explicit guest layout through XG layout queries, copy in and out, and texture sampling. The supported shape is 1024×1024 with six BC5_UNORM or BC7_UNORM mips, one slice and sample, layout 0x109 (64 KiB standard, no XOR), default alignment and zero flags. Each of the three smallest levels lives within guest tile zero. The D3D12 upload stages each level using its desktop footprint. The same guest addressing rule is used by an address SRV and by the uploader for a resource placed at a title address. The automated GPU test exercises the address SRV path. The reference six offsets and every visible 16-byte block address were compared offline with the Mesa 25.1.0 AMD addrlib at 5c142e46, using the existing Navi21 configuration. Independent checks of the per-level offsets and block addresses matched the implementation published at ivall/xcl revision 64b3f355. The regression runs on source-built data and needs neither reference tree at runtime. Windows 11 build 26200.9974, x64 MSVC Release, NVIDIA RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Tested at 47e91d85. ```powershell cmake --build --preset release --target startup_stream_consumer ctest --preset release --no-tests=error --output-on-failure -R '^startup_(xg_bc_chain_|xg_bc7_(layout|draw)|address_(bc_view|srv))' ``` Two new and seven existing cases passed, with zero skips. Each format/backend pair checked all 87,360 guest block locations, row and tile padding, an invalid subresource, size/offset/tile queries, and 12,288 GPU pixels. Forcing mip zero in the second half of the draw changed 5,120 of the 6,144 pixels in each pair, as expected. Running an independent uniquely tagged block fixture on the prior shim yielded zero correct guest positions in each copy direction. The production evidence for this PR is limited to the software contract exercised by the source-built fixtures. This does not change DirectStorage or apply any file offset correction.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:56:10 +00:00
github manually merged commit 47e91d853f into gh-pr/1300/base 2026-11-26 22:56:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.