Decode compact TTPF 2D streaming profiles and packed mip tails #5
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!5
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/5/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:49 UTC · original
feat/ttpf-compact-packed-tail→main· +452 −94 · 4 files · 1 commits · merged 2026-11-22 00:04 UTCSummary
Replaces the 55-entry
ValidatedCompactProfile/ValidatedAuxiliaryProfiletables inTtpfReaderwith a direct validator for the ETPF634 streaming chunk metadata, generalizes the 2D tile-size rule, and enables full mip-chain decoding (including packed mip tails) for compact 2D textures.What changed
Core/TtpfReader.cs:meta = c >> 21andd(TryDecodeChunkPages/TryValidateChunkSizes/ValidateCompactStreamingChunks): four 5-bit zero-terminated chunk page-count codes checked against actual RDS5 chunk virtual sizes, plusd >> 19alignment-group padding checks fornonTail == 3chains (alignGroup1:c0 + pad = 16, 2:c0 + c1 + pad = 16, 3:c0 + c1 + pad = 8).(mode & 6) == 0 ? 65536 : 4096for single-slice 2D tiling (SW_64KB_Dfor modes0, 1, 32;SW_4KB_Sfor modes2, 4, 5, 6, 7, 34, 36, 38).NonTailMipCountcap so packed mip tails decode through standardSurfaceLayoutwhenever their chunks are raw/zlib.LegacyTopOnlyNamebehavior (297entries) and keepsSupportsNativeReplacementstrictly restricted to single-slice 2D non-compactmode is 0 or 2textures (78,624entries, unchanged).Core/ArchiveReader.cs:Tests/TtpfLayoutSmoke/:.NET 8synthetic RDS5/ETPF634 smoke test verifyingmode=4(nt=1andnt=3),mode=6(nt=3),mode=1(SW_64KB_D), packed mip-tail detiling, BCPack lower-mip fallback, and negative controls (mismatched chunk codes, bad alignment padding, reserved bits, all-BCPack rejection,Rds5TextureWriterrejection).Verification
dotnet build Tests/TtpfLayoutSmoke/TtpfLayoutSmoke.csproj -c Release+ run — passed (0 warnings, 0 errors).App/RpfPreview.App.csproj(.NET 10),Tools/IndexBuilder/IndexBuilder.csproj(.NET 8), and Leonidatools/rpf9dump/rpf9dump.csproj(.NET 8).308,895→330,198(+21,303)98,603→305,264(+206,661)210,292→24,934(-185,358)48,220→26,917(26,215all-BCPack,678array/volume,24unsupported format = 5 DXGI 11 + 19 2-slice arrays addressed in a follow-up PR).AI-assisted. Tested on Windows x64, .NET 10.0.401 SDK, NVIDIA GeForce RTX 3060 Ti (driver 621.24).