GPUOpen-Tools / compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DDS output dwPitchOrLinearSize borked

tamlin-mike opened this issue · comments

DDS file output produces invalid DDS_HEADER.dwPitchOrLinearSize (a.k.a. DDSURFACEDESC2.dwLinearSize).

For a mipmapped compressed DDS (BC7, but should apply to all compressed DDS formats) of size 1024x1024, compressonatorcli generates dwLinearSize 4096.

That's... not entirely correct. (hint: sqrt(4096) != 1024) :-)

It should be 1MB (in this case, with a 4:1 compression).

While I have not looked at the src emitting this incorrect value, the binary representations of these two values could suggest an erroneous big-/little-endian conversion.
4K = 00 10 00 00
1M = 00 00 10 00