textures: verify strict two-block BCPack decode through GPU readback #879

Merged
stan495 merged 1 commit from upstream-pr/886 into main 2026-11-23 16:03:20 +00:00
stan495 commented 2026-11-23 15:50:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T15:50:18Z.


Fixes #769.

  • Use the synthetic 132-byte two-block stream from the original fixture at 5e1af169. Build the expected mode-6 blocks and the 8x4 RGBA reference independently from their endpoints and selectors.
  • Feed the strict decoder's ordered 32-byte output to --check-bc7 and compare the complete capture through the translated copy shader. Register bc7_mode6_multiblock_warp and bc7_mode6_multiblock_hardware separately.
  • Require the first mismatch at (0, 0) after swapping blocks and at (7, 3) after changing the last selector. Truncations at 131, 66 and 32 bytes fail before upload. The first diagnostic at 131 bytes is lane 10 (width 6, q 0) at input byte 131: input ran out.

Verification

Tested 71ad6ef3a0658b9c73d68e6f47687c13feba9dbd on Windows 11 build 26200.9974. Both Microsoft Basic Render Driver (WARP 10.0.26100.9818) and Radeon RX 7900 XTX (32.0.32029.2010) matched all 32 pixels and 128 channels exactly. The D3D12 debug layer was enabled and reported zero errors or warnings on the positive draw.

With the pinned Leonida checkout under out/Leonida and the repository Python environment configured:

. .\tools\dev.ps1
$env:BCPACK_REFERENCE_TOOLS = (Resolve-Path 'out/Leonida/tools').Path
$env:XBOX2WINDOWS_ADAPTER = 'AMD Radeon RX 7900 XTX'
cmake --preset dev
cmake --build --preset dev --target offscreen_check --parallel 6
ctest --preset dev --no-tests=error -R '^(bc7_mode6_multiblock_(warp|hardware)|bc7_draw_(warp|hardware)|bc7_block_reference|bcpack_rans_symbols)$' -V
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py

All six selected CTest entries passed, including the original single-block case. The optional texture2ddecoder comparison inside bc7_block_reference was skipped. Both documentation checks passed. With BCPACK_REFERENCE_TOOLS unset, the two new tests report a skip.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6563119086 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/886). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T15:50:18Z. --- Fixes #769. - Use the synthetic 132-byte two-block stream from the original fixture at `5e1af169`. Build the expected mode-6 blocks and the 8x4 RGBA reference independently from their endpoints and selectors. - Feed the strict decoder's ordered 32-byte output to `--check-bc7` and compare the complete capture through the translated copy shader. Register `bc7_mode6_multiblock_warp` and `bc7_mode6_multiblock_hardware` separately. - Require the first mismatch at `(0, 0)` after swapping blocks and at `(7, 3)` after changing the last selector. Truncations at 131, 66 and 32 bytes fail before upload. The first diagnostic at 131 bytes is `lane 10 (width 6, q 0) at input byte 131: input ran out`. ## Verification Tested `71ad6ef3a0658b9c73d68e6f47687c13feba9dbd` on Windows 11 build 26200.9974. Both Microsoft Basic Render Driver (WARP 10.0.26100.9818) and Radeon RX 7900 XTX (32.0.32029.2010) matched all 32 pixels and 128 channels exactly. The D3D12 debug layer was enabled and reported zero errors or warnings on the positive draw. With the [pinned Leonida checkout](https://github.com/timelery/Leonida/tree/03d1e118a676d73aba66b1793cf033f6ad23b2b2/tools) under `out/Leonida` and the repository Python environment configured: ```powershell . .\tools\dev.ps1 $env:BCPACK_REFERENCE_TOOLS = (Resolve-Path 'out/Leonida/tools').Path $env:XBOX2WINDOWS_ADAPTER = 'AMD Radeon RX 7900 XTX' cmake --preset dev cmake --build --preset dev --target offscreen_check --parallel 6 ctest --preset dev --no-tests=error -R '^(bc7_mode6_multiblock_(warp|hardware)|bc7_draw_(warp|hardware)|bc7_block_reference|bcpack_rans_symbols)$' -V python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py ``` All six selected CTest entries passed, including the original single-block case. The optional `texture2ddecoder` comparison inside `bc7_block_reference` was skipped. Both documentation checks passed. With `BCPACK_REFERENCE_TOOLS` unset, the two new tests report a skip.
upstream-sync closed this pull request 2026-11-24 06:45:14 +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!879
No description provided.