BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.73k stars 267 forks source link

Unpacker produces non-valid KTX files #286

Closed MikuAuahDark closed 2 years ago

MikuAuahDark commented 2 years ago

According to https://www.khronos.org/registry/KTX/specs/1.0/ktxspec_v1.html, for compressed textures, glTypeSize must be set to 1, but currently all transcoded texture set this to 0.

glTypeSize

glTypeSize specifies the data type size that should be used when endianness conversion is required for the texture data stored in the file. If glType is not 0, this should be the size in bytes corresponding to glType. For texture data which does not depend on platform endianness, including compressed texture data, glTypeSize must equal 1.

I discovered this when astcenc decoder complains of the resulting ASTC KTX file is invalid so I wrote simple Lua script to extract the KTX header information and found these.

richgel999 commented 2 years ago

Got it - will fix. Thanks for the report!

richgel999 commented 2 years ago

Fix is checked in. The resulting KTX files are compatible with AMD Compressonator, which is a good sign. I'll push out a new EXE tonight. Thanks again!