dds_png: decode R8G8_SNORM previews #2317

Merged
ZroIsHere merged 1 commit from upstream-pr/2317 into main 2026-11-26 18:28:49 +00:00
ZroIsHere commented 2026-11-26 13:46:01 +00:00 (Migrated from github.com)

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


Summary

Add DDS preview decoding for DXGI R8G8_SNORM (format 51). Map its signed red and green channels from [-1, 1] to 8-bit values, with blue set to zero and alpha set to 255. The minimum encoded value maps to -1 as required for signed normalized formats.

The decoder validates row pitch and truncated payloads. Update the tex_export.py help text to include the format.

Validation

  • git diff --check
  • Python AST parse
  • Tests not run.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5511172120 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2317). Originally posted by [ZroIsHere](https://github.com/ZroIsHere) on 2026-11-26T13:46:01Z. --- ## Summary Add DDS preview decoding for DXGI R8G8_SNORM (format 51). Map its signed red and green channels from [-1, 1] to 8-bit values, with blue set to zero and alpha set to 255. The minimum encoded value maps to -1 as required for signed normalized formats. The decoder validates row pitch and truncated payloads. Update the tex_export.py help text to include the format. ## Validation - git diff --check - Python AST parse - Tests not run.
aslan2142 commented 2026-11-26 18:29:00 +00:00 (Migrated from github.com)

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


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

  • Test added: a synthetic R8G8_SNORM test (-128, -127, 0, 127, ±64, ±1; padded rows; truncation).
  • Decoder: unchanged.

Thanks @ZroIsHere.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200513184 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2317#issuecomment-7200513184). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-26T18:29:00Z. --- Merged through the integration PR #2394 (DDS preview formats batch), as head `893f1a0f4`, with a merge commit, so your commits stay yours. - **Test added:** a synthetic R8G8_SNORM test (-128, -127, 0, 127, ±64, ±1; padded rows; truncation). - **Decoder:** unchanged. Thanks @ZroIsHere. AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
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!2317
No description provided.