Preserve A8 mask alpha in texture previews #28
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!28
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/28/head"
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?
@ifBars on GitHub · 2026-11-23 03:29 UTC · original
ifBars:fix/a8-preview-alpha→master· +25 −4 · 1 files · 1 commits · merged 2026-11-23 04:01 UTCA8 masks currently go through
Fmt::R8, which turns the stored alpha into opaque grayscale. An input alpha of zero becomes[0, 0, 0, 255], so a PNG export loses its transparency. DXGI defines format 65 as alpha-only.This gives A8 its own format variant and preserves the input byte in alpha, with white RGB for displaying the mask. R8 keeps its existing grayscale preview. Element size and DDS source bytes stay the same.
The synthetic alpha test fails before the fix; both A8 and R8 tests pass afterward.
cargo test --locked -p sixng-core --no-default-features --libpasses 98 tests with one existing test ignored. I also checked all eight mips of a real A8 texture against a separate reader; all match. No game data is included.