Decode the BC5 cloud volume: 3D layout for 16-byte blocks and its mip chain #372
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!372
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/372/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?
@holdmysocks on GitHub · 2026-11-26 15:53 UTC · original
holdmysocks:six-bc-volume→master· +56 −24 · 3 files · 1 commits · merged 2026-11-26 16:01 UTCThe one block-compressed volume in the install, a BC5 128×128×128 cloud volume with 8 mips, now decodes and exports whole: a 3D DDS with all 128 slices and all 8 mips, plus
<name>_slices.png. Before, it exported a garbled first slice. This was the last gap left by PRs 289 and 300.Bricks. BC blocks are the elements: 16 bytes, 32×32 blocks per slice.
Mip chain. It uses the same per-layer layout as the R8 fog volume from PR 289. Each 8-deep brick layer holds, at 43 blocks a layer:
The empty blocks in later layers sit exactly where the shorter mips run out of depth.
Tail. Mips 3–6 sit at bytes 2048, 768, 512 and 256, the same slots as the fog volume. Mip 7 is at byte 0, the one tail element left over (167 nonzero = 128 + 32 + 4 + 2 + 1). Mip 3 is 16 deep, so it continues in the second layer's tail.
Tail rule. It changes from "at most half a brick wide" to "no wider than a brick, at most half a brick high". That fits both volumes. The fog volume's layout is unchanged, and its unit test still passes.
Checked on the exported DDS with a full BC5 pixel decode:
Scope. Chains are mapped for 1- and 16-byte elements only. BC volumes are mapped for 16-byte blocks only. No volume uses BC1 or BC4. The store reader is unchanged: it still rejects compressed and mipped volumes.
Checked with
cargo check --workspace --all-targetsandcargo test -p sixng-core -p sixng-gui --release.