Decode TTPF 2D arrays, streaming cubemaps, and 3D volumes #6
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/breadbbbb--rpf9-explorer!6
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/6/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?
@sombraSoft on GitHub · 2026-11-21 22:57 UTC · original
feat/ttpf-arrays-cubes-volumes→main· +823 −130 · 5 files · 2 commits · merged 2026-11-22 00:04 UTCSummary
Stacked on #5. Decodes all supported multi-slice TTPF layouts (2D arrays, streaming cubemaps, and 3D volumes) and wires the viewer's slice/face selector for TTPF previews. Intentionally leaves DXGI format 11 (
Core/RageTextureDecoder.cs) untouched to avoid conflicting with #4.What changed
Core/TtpfReader.cs:format/depthbit boundary in ETPF descriptor wordb:formatis 7 bits ((b >> 3) & 0x7F) anddepthis 11 bits (((b >> 10) & 0x7FF) + 1). This resolves the 19 previously misparsed 2-slice arrays (format >= 128) as well as all 2D arrays, cubemaps, and volumes.dim=1, depth>1, mode=1, 127 records): adds mip-majorSW_64KB_DArrayLayout(packed taildepth * 64 KiBat offset 0, followed by standalone mipsfirstTail - 1 .. 0laid out mip-major across slices).dim=2, depth=6, mode=18 + 2*nonTail, 567 records): validates allnonTail + 1streaming snapshot chunks (ValidateCubemapStreamingChunksreusingTryValidateChunkSizes) and reads the full-resolution 6-face slice-majorSW_4KB_Scubemap from the final chunk (with 64 KiB alignment check whennonTail > 0andfacesBytes >= 36 * 4096).dim=3, depth>=2, mode=2, mips=1, 3 records): adds overflow-checkedSW_4KB_S3DVolumeLayout+VolumePatterns(rejecting unvalidatedmips != 1).TEXTURE2Darrays,TEXTURECUBE, andTEXTURE3DDDS files, supports multi-sliceDecodeTexturePixels(path, index, slice), addsExportDepth/ShapeonTtpfTextureInfo, preserves full allocation spans inLayout.SizeforRds5TextureWriter, and keepsSupportsNativeReplacementdisabled for all multi-slice textures.App/MainWindow.Assets.cs:AssetSliceSelectorandShowTtpfSliceAsyncfor TTPF arrays, cubemaps, and 3D volumes, and displays texture shape/3D depth in Details and preview metadata.Tests/TtpfLayoutSmoke/Program.cs:Rds5TextureWriterrejection.Verification
Tests/TtpfLayoutSmoke(.NET 8, Release) — passed (0 warnings, 0 errors).App/RpfPreview.App.csproj(.NET 10),Tools/IndexBuilder/IndexBuilder.csproj(.NET 8),tools/rpf9dump/rpf9dump.csproj(.NET 8).330,892(+21,997overmain; Full:305,954, Partial:24,938)124 / 127exported (120full,4partial,3all-BCPack)567 / 567exported (567full)3 / 3exported (3full)26,223(26,218all-BCPack +5DXGI format 11 handled by #4;0layout skips).ddsOk=722, ddsFail=0, pxOk=1,416, pxFail=0.rpf9dump ttpfsmoke test onttdb_graphics.ttpf:ok=903 fail=0 skip=9.AI-assisted. Tested on Windows x64, .NET 10.0.401 SDK, NVIDIA GeForce RTX 3060 Ti (driver 621.24).