textures: return the typed DXGI value for BC4 UNORM #3277

Manually merged
github merged 1 commit from github-bot/gh-3275 into gh-pr/3275/base 2026-11-28 05:08:28 +00:00 AGit
Owner

@⁠wish131400 on GitHub · 2026-11-28 04:52 UTC · original
wish131400:textures/bc4-unorm-dxgi → main · +21 −3 · 4 files · 1 commits · merged 2026-11-28 05:02 UTC

texture_blocks.format_info("BC4_UNORM") currently returns 79, the public DXGI value for BC4_TYPELESS. Return the typed UNORM value, 80. Both have eight-byte blocks, so layout checks alone did not expose the mismatch.

Correct both existing format-table expectations and document the limited scope of this fix. This changes format metadata; it does not establish a change in rendered textures or BCPack decoding.

Validation on Windows 10, Python 3.14, based on 240e0fb9c460f24d51683abe2d4cce2800b136c1:

  • python -B tests/texture_blocks_check.py: 6 tests passed.
  • python -B tests/texture_bc_volume_check.py: 11 tests passed.
  • With the corrected test expectations and the original implementation, both checks fail with 79 != 80.
  • Independently checked the two enum values against the public Windows SDK dxgiformat.h.
  • git diff --check passed.

All fixtures are synthetic. No SDK redistributables or captured assets are included.

**@⁠wish131400** on GitHub · 2026-11-28 04:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3275) `wish131400:textures/bc4-unorm-dxgi` → `main` · +21 −3 · 4 files · 1 commits · merged 2026-11-28 05:02 UTC `texture_blocks.format_info("BC4_UNORM")` currently returns 79, the public DXGI value for `BC4_TYPELESS`. Return the typed UNORM value, 80. Both have eight-byte blocks, so layout checks alone did not expose the mismatch. Correct both existing format-table expectations and document the limited scope of this fix. This changes format metadata; it does not establish a change in rendered textures or BCPack decoding. Validation on Windows 10, Python 3.14, based on `240e0fb9c460f24d51683abe2d4cce2800b136c1`: - `python -B tests/texture_blocks_check.py`: 6 tests passed. - `python -B tests/texture_bc_volume_check.py`: 11 tests passed. - With the corrected test expectations and the original implementation, both checks fail with `79 != 80`. - Independently checked the two enum values against the public Windows SDK `dxgiformat.h`. - `git diff --check` passed. All fixtures are synthetic. No SDK redistributables or captured assets are included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:56:07 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 05:02 UTC · original · approved these changes

Independent check on ad9a0c5a: the installed Windows SDK 10.0.26100 dxgiformat.h defines BC4_TYPELESS as 79 and BC4_UNORM as 80. python -B tests/texture_blocks_check.py passed 6/6 and python -B tests/texture_bc_volume_check.py passed 11/11. Reverting just the format number in the isolated worktree made both suites fail with 79 != 80; the original bytes were restored. The block extent and size are unchanged.

**@⁠R0Y00** on GitHub · 2026-11-28 05:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3275#pullrequestreview-6095925414) · **approved these changes** Independent check on `ad9a0c5a`: the installed Windows SDK 10.0.26100 `dxgiformat.h` defines `BC4_TYPELESS` as 79 and `BC4_UNORM` as 80. `python -B tests/texture_blocks_check.py` passed 6/6 and `python -B tests/texture_bc_volume_check.py` passed 11/11. Reverting just the format number in the isolated worktree made both suites fail with `79 != 80`; the original bytes were restored. The block extent and size are unchanged.
github-bot changed target branch from main to gh-pr/3275/base 2026-11-28 05:08:26 +00:00
github manually merged commit ad9a0c5ac2 into gh-pr/3275/base 2026-11-28 05:08:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.