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

Merged
R0Y00 merged 1 commit from upstream-pr/1300 into main 2026-11-24 07:25:48 +00:00
R0Y00 commented 2026-11-24 07:18:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:18:23Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6576713884 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1300). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T07:18:23Z. --- 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.
upstream-sync closed this pull request 2026-11-24 08:01:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
R0Y00/Xbox2Windows!1293
No description provided.