dds_png: decode DXGI R16G16B16A16_UNORM previews #2157

Closed
ZroIsHere wants to merge 0 commits from upstream-pr/2157 into main
ZroIsHere commented 2026-11-26 00:26:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ZroIsHere on 2026-11-26T00:26:26Z.


Claimed: DDS-RGBA16-UNORM

What and why

Add DXGI format 11 (R16G16B16A16_UNORM) to the DDS preview decoder. Normalize all four 16-bit channels to RGBA8 with half-up rounding, including row-pitch validation and padding. A synthetic two-row case covers channel boundaries and padded rows.

Tested

Not run in this change. The regression case is synthetic and uses no game data.

GPUs tested: n/a

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5501617991 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2157). Originally posted by [ZroIsHere](https://github.com/ZroIsHere) on 2026-11-26T00:26:26Z. --- Claimed: DDS-RGBA16-UNORM ### What and why Add DXGI format 11 (`R16G16B16A16_UNORM`) to the DDS preview decoder. Normalize all four 16-bit channels to RGBA8 with half-up rounding, including row-pitch validation and padding. A synthetic two-row case covers channel boundaries and padded rows. ### Tested Not run in this change. The regression case is synthetic and uses no game data. GPUs tested: n/a AI-assisted: yes
real-rusher commented 2026-11-26 10:12:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:12:48Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly into main. With this PR, python -I tests/test_dds_png_dx10.py: 6 tests OK. The PR's test file against main's tools/dds_png.py: 1 error, so the new test fails on main and passes with the change. compileall clean.

Note for review: it conflicts with #2158 (tools/dds_png.py, tests/test_dds_png_dx10.py) and with #2218 (tools/dds_png.py, tools/tex_export.py), which add formats to the same tables, so whichever lands later needs a rebase.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189059967 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2157#issuecomment-7189059967). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T10:12:48Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly into main. With this PR, python -I tests/test_dds_png_dx10.py: 6 tests OK. The PR's test file against main's tools/dds_png.py: 1 error, so the new test fails on main and passes with the change. compileall clean. Note for review: it conflicts with #2158 (tools/dds_png.py, tests/test_dds_png_dx10.py) and with #2218 (tools/dds_png.py, tools/tex_export.py), which add formats to the same tables, so whichever lands later needs a rebase. AI-assisted: yes (Claude Code)
aslan2142 commented 2026-11-26 18:28:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-26T18:28:55Z.


Merged through the integration PR #2394 (DDS preview formats batch), as head 7286d7823, with a merge commit, so your commits stay yours.

  • Your decoder and test are unchanged.
  • The tex_export.py and dds_png.py docstrings were merged into one format list with the other batch PRs.

Thanks @ZroIsHere, and thanks to real-rusher for the check.

AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200511865 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2157#issuecomment-7200511865). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-26T18:28:55Z. --- Merged through the integration PR #2394 (DDS preview formats batch), as head `7286d7823`, with a merge commit, so your commits stay yours. - Your decoder and test are unchanged. - The `tex_export.py` and `dds_png.py` docstrings were merged into one format list with the other batch PRs. Thanks @ZroIsHere, and thanks to real-rusher for the check. AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)

Pull request closed

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
ProjectLeonida/mandy!2157
No description provided.