texture: add BC and volume readback #1098

Merged
lambirou merged 1 commit from upstream-pr/1105 into main 2026-11-24 01:36:19 +00:00
lambirou commented 2026-11-24 01:05:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T01:05:23Z.


Change

Add a synthetic BC1–BC7 and volume readback table with byte-exact controls.

  • tools/texture_blocks.py maps BC1–BC7 and a volume BC7 family to block size, bytes per block
    and volume layout, and raises a named error for an unknown format.
  • tests/texture_bc_volume_check.py builds tagged BC blocks for each supported format and a
    small 3D BC7 volume, then compares the readback with an independent CPU oracle.
  • Negative controls cover a wrong block pitch, wrong volume slice order/size and an unknown
    format name in the exception.
  • The check is registered in the Linux Python job and the AGENTS list; CMake also exposes it.

This is offline byte-exact texture tooling. It does not claim a runtime upload, a GPU draw or a
console format path.

Verification

  • out\pe-env\Scripts\python.exe -B tests/texture_bc_volume_check.py
    • Ran 10 tests ... OK.
  • Positive: every BC1–BC7 block and the volume slices round-trip byte-for-byte against the
    independent oracle.
  • Controls: wrong pitch first differs at the documented block; wrong volume order/size raises the
    named shape error; unknown format raises its name.
  • docs_links_check.py: Self-test passed., Checked 15 Markdown files and 246 links..
  • git diff --check origin/main...HEAD: clean.
  • Not run: a runtime texture upload, GPU draw, the full CTest suite and release CI.

Evidence and follow-up

  • Branch texture/bc-volume, head 4480a13, based on the current origin/main after
    XCL-22.
  • Format sizes and block order are public BC/GFX10 layout evidence already used by the BC7
    tools; the oracle and first-difference controls guard against a self-consistent wrong layout.
  • docs/experiments.md records the formats, volume shape and negative controls.
  • Follow-up: a runtime texture path, console packed formats and other format families remain
    separate work.
  • No game files, dumps, shader bytes, title paths or secrets are included.

Checklist

  • One reviewable behavior: BC1–BC7 and volume block readback.
  • Independent oracle, byte-exact positive and pitch/volume/format controls.
  • Documentation and Linux Python job updated.
  • No game files, dumps, logs or secrets.
  • Provenance checked; no XCL code used.
  • AI-assisted (Codex).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572232814 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1105). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T01:05:23Z. --- ## Change Add a synthetic BC1–BC7 and volume readback table with byte-exact controls. - `tools/texture_blocks.py` maps BC1–BC7 and a volume BC7 family to block size, bytes per block and volume layout, and raises a named error for an unknown format. - `tests/texture_bc_volume_check.py` builds tagged BC blocks for each supported format and a small 3D BC7 volume, then compares the readback with an independent CPU oracle. - Negative controls cover a wrong block pitch, wrong volume slice order/size and an unknown format name in the exception. - The check is registered in the Linux Python job and the AGENTS list; CMake also exposes it. This is offline byte-exact texture tooling. It does not claim a runtime upload, a GPU draw or a console format path. ## Verification - `out\pe-env\Scripts\python.exe -B tests/texture_bc_volume_check.py` - `Ran 10 tests ... OK`. - Positive: every BC1–BC7 block and the volume slices round-trip byte-for-byte against the independent oracle. - Controls: wrong pitch first differs at the documented block; wrong volume order/size raises the named shape error; unknown format raises its name. - `docs_links_check.py`: `Self-test passed.`, `Checked 15 Markdown files and 246 links.`. - `git diff --check origin/main...HEAD`: clean. - Not run: a runtime texture upload, GPU draw, the full CTest suite and release CI. ## Evidence and follow-up - Branch `texture/bc-volume`, head `4480a13`, based on the current `origin/main` after XCL-22. - Format sizes and block order are public BC/GFX10 layout evidence already used by the BC7 tools; the oracle and first-difference controls guard against a self-consistent wrong layout. - `docs/experiments.md` records the formats, volume shape and negative controls. - Follow-up: a runtime texture path, console packed formats and other format families remain separate work. - No game files, dumps, shader bytes, title paths or secrets are included. ## Checklist - [x] One reviewable behavior: BC1–BC7 and volume block readback. - [x] Independent oracle, byte-exact positive and pitch/volume/format controls. - [x] Documentation and Linux Python job updated. - [x] No game files, dumps, logs or secrets. - [x] Provenance checked; no XCL code used. - [x] AI-assisted (Codex).
upstream-sync closed this pull request 2026-11-24 06:46:20 +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!1098
No description provided.