From 1c4140792def36042d641ec7456817a1f73512ba Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sun, 11 Oct 2026 18:45:54 +0400 Subject: fix: decode TEXM 888 channels in native order --- docs/reference/texm.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/texm.md b/docs/reference/texm.md index db4321e..9f2f23d 100644 --- a/docs/reference/texm.md +++ b/docs/reference/texm.md @@ -24,12 +24,16 @@ struct TexmHeader32 { 556 R5 G5 B6 4444 A4 R4 G4 B4 88 L8 A8 -888 RGB8 in four-byte element -8888 A8 R8 G8 B8 +888 packed 0xXXRRGGBB; little-endian bytes [B,G,R,X], RGBA output uses alpha 255 +8888 packed 0xAARRGGBB; little-endian bytes [B,G,R,A], decoded as RGBA ``` Короткие каналы расширяются до 8 bits повторением значимых bits. Для 888 -служебный четвёртый byte сохраняется при roundtrip. +служебный четвёртый byte сохраняется в raw mip, но не попадает в RGBA output. +Native Ngi32 code confirms this layout: VA `0x10005930` packs `0xAARRGGBB` into +ARGB4444, while VA `0x1000F620`/`0x1000F70C` route 888/8888 through the byte-copy +path at `0x1000F730`, without a channel swizzle. On disk, little-endian bytes +are `[B,G,R,A]` for 8888 and `[B,G,R,X]` for 888. ## Layout -- cgit v1.2.3