dds_png: preview signed and unsigned BC6H textures #2248
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2248"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-26T10:23:51Z.
Claimed in the coordination issue as: DDS-PNG-BC6H-PREVIEW
Depends on: #140 (overlapping changes in the existing BC7 decoder). #2247 (adjacent format-dispatch cases; keep both handlers when merging). Each branch builds directly on main. These references flag textual merge conflicts.
What and why
Decode signed and unsigned BC6H subresources using the repository’s BC6H block decoder. Reuse the BC7 block traversal and cache, clip blocks at texture edges and map linear RGB to the eight-bit preview range. The synthetic fixtures cover both signedness variants and an incomplete block.
Tested
Windows, Python 3.14.7. The regression failed on the parent commit and passed with this change.
python -I tests/test_dds_subresources.pypython -I tests/test_dds_png.pypython -I tests/test_ttpf_mips.pygit diff --checkand the changed-path no-game-data scan passed.GPUs tested: N/A (synthetic CPU tests).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:42:36Z.
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
tests/test_dds_png.py+tests/test_dds_subresources.py: 114 passed, 173 subtests passed (main: 113 passed, 172 subtests).(AI-assisted test run; output checked by hand.)
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T11:08:20Z.
Review: COMMENTED
Windows 11: 100 DDS/PNG tests and 14 subresource tests passed. I also ran the isolated CLI on authored BC6H UF16 and SF16 blocks, verified metadata plus the exact 4×4 PNG pixels, and checked rejection of typeless BC6H. No findings from these checks.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T15:50:29Z.
Review: COMMENTED
Re-verified after rebase at
7811fd88c(merged cleanly ontomainec91d695c).python -I -B tests/test_dds_png.py -v(100/100) andpython -I -B tests/test_dds_subresources.py -v(14/14, including signed/unsigned BC6H clamping, edge clipping, and truncation) passed;scripts/check_no_game_data.pyandgit diff --checkclean.decode_bc6h_block()intools/ttpf_mips.pyproduces finite IEEE 754 half-float values (clamped to0x7BFF), so the[0, 1]preview clamp in_decode_bptc()cannot fail onNaN/inf.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T23:38:12Z.
Tested
7811fd88cmerged (no commit) withmainaa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.test_dds_png.py(102 tests) andtest_dds_subresources.py(14 tests) pass.tools/dds_png.pyback tomain,test_dds_subresources.pyerrors twice (Unsupported DXGI format: 96, BC6H signed).No blocker from my side.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T23:48:34Z.
Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto
mainace0e9d1cwithout conflict, and its test file(s) (tests/test_dds_png.py,tests/test_dds_subresources.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.