textures: compare all eight BC7 modes with D3D12 #192

Merged
Vonsek merged 1 commit from upstream-pr/193 into main 2026-11-21 18:16:24 +00:00
Vonsek commented 2026-11-21 18:13:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:13:40Z.


Change

The BC7 draw tests now feed the existing 64×128 CPU reference fixture to the translated copy shader. The 512 blocks exercise all eight encoding modes, all valid partition choices and all mode-4 rotation/index-selection combinations. Previously the draw tests generated only mode-6 blocks. The existing mip and fallback draws still run.

Verification

Tested commit 83031b5 from a fresh build on Windows 11 x64 build 26200, Python 3.12.10:

python -m venv out/pe-env
.\out\pe-env\Scripts\python.exe -m pip install -r requirements-dev.txt
. ./tools/dev.ps1
$bc7Python = (Resolve-Path out/pe-env/Scripts/python.exe).Path
cmake --preset dev "-DINTAKE_PYTHON=$bc7Python"
cmake --build --preset dev --target offscreen_check --parallel 4
ctest --preset dev --no-tests=error -R '^bc7_draw_(warp|hardware)$' -V
$bc7Dxc = (Get-Command dxc.exe).Source
.\out\pe-env\Scripts\python.exe -B tests/bc7_draw_check.py $bc7Dxc out/build/dev/offscreen_check.exe warp

Both CTests and the direct WARP invocation passed. Each adapter compared 8,192 texels, 32,768 channels, with maximum absolute error zero on the new surface. WARP used the Microsoft Basic Render Driver 10.0.26100.9818. Hardware used the NVIDIA GeForce RTX 5080 with driver 32.0.16.1692. The debug layer was unavailable on both. No capability skips.

Evidence and follow-up

The existing MIT-licensed generator assigns the BC7 block fields in source, packs them, and decodes their expected pixels on the CPU. The new test runs its CLI and uploads the blocks as a BC7 texture. For the negative control it flips the low bit of the first mode-4 block's rotation while retaining its original expected pixels. Both backends rejected the changed block with the first mismatch at (16, 0). WARP read red/alpha as 0.933105/0.462646 against the expected 0.462646/0.933105.

The BC7 experiment notes record the comparison. AI-assisted contribution.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for the fixture checks.
  • I considered a negative control or failure case for a new fixture.
  • I updated the experiment notes.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6532598618 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/193). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T18:13:40Z. --- ## Change The BC7 draw tests now feed the existing 64×128 CPU reference fixture to the translated copy shader. The 512 blocks exercise all eight encoding modes, all valid partition choices and all mode-4 rotation/index-selection combinations. Previously the draw tests generated only mode-6 blocks. The existing mip and fallback draws still run. ## Verification Tested commit `83031b5` from a fresh build on Windows 11 x64 build 26200, Python 3.12.10: ```powershell python -m venv out/pe-env .\out\pe-env\Scripts\python.exe -m pip install -r requirements-dev.txt . ./tools/dev.ps1 $bc7Python = (Resolve-Path out/pe-env/Scripts/python.exe).Path cmake --preset dev "-DINTAKE_PYTHON=$bc7Python" cmake --build --preset dev --target offscreen_check --parallel 4 ctest --preset dev --no-tests=error -R '^bc7_draw_(warp|hardware)$' -V $bc7Dxc = (Get-Command dxc.exe).Source .\out\pe-env\Scripts\python.exe -B tests/bc7_draw_check.py $bc7Dxc out/build/dev/offscreen_check.exe warp ``` Both CTests and the direct WARP invocation passed. Each adapter compared 8,192 texels, 32,768 channels, with maximum absolute error zero on the new surface. WARP used the Microsoft Basic Render Driver 10.0.26100.9818. Hardware used the NVIDIA GeForce RTX 5080 with driver 32.0.16.1692. The debug layer was unavailable on both. No capability skips. ## Evidence and follow-up The existing MIT-licensed generator assigns the BC7 block fields in source, packs them, and decodes their expected pixels on the CPU. The new test runs its CLI and uploads the blocks as a BC7 texture. For the negative control it flips the low bit of the first mode-4 block's rotation while retaining its original expected pixels. Both backends rejected the changed block with the first mismatch at (16, 0). WARP read red/alpha as 0.933105/0.462646 against the expected 0.462646/0.933105. The [BC7 experiment notes](https://github.com/Vonsek/Xbox2Windows/blob/83031b5b62cbf93f730a42c42408189fa0be3e43/docs/experiments.md#drawing-bc7-textures-with-a-recompiled-pixel-shader) record the comparison. AI-assisted contribution. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for the fixture checks. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated the experiment notes. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:41:45 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:14:32Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T18:16:07.547256Z 83031b5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067107596 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/193#issuecomment-7067107596). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T18:14:32Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"83031b5b62cbf93f730a42c42408189fa0be3e43","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T18:16:07.547256Z">2026-11-21T18:16:07.547256Z</relative-time> | `83031b5` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
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!192
No description provided.