Incorrect KTX file structure when use PVRTexLib

This topic contains 2 replies, has 2 voices, and was last updated by  oiram 5 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30935

    oiram
    Member

    Here is the KTX file structure from http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec

    Byte[12] identifier
    UInt32 endianness
    UInt32 glType
    UInt32 glTypeSize
    UInt32 glFormat
    Uint32 glInternalFormat
    Uint32 glBaseInternalFormat
    UInt32 pixelWidth
    UInt32 pixelHeight
    UInt32 pixelDepth
    UInt32 numberOfArrayElements
    UInt32 numberOfFaces
    UInt32 numberOfMipmapLevels
    UInt32 bytesOfKeyValueData

    for each keyValuePair that fits in bytesOfKeyValueData
    UInt32 keyAndValueByteSize
    Byte keyAndValue[keyAndValueByteSize]
    Byte valuePadding[3 - ((keyAndValueByteSize + 3) % 4)]
    end

    for each mipmap_level in numberOfMipmapLevels*
    UInt32 imageSize;
    for each array_element in numberOfArrayElements*
    for each face in numberOfFaces
    for each z_slice in pixelDepth*
    for each row or row_of_blocks in pixelHeight*
    for each pixel or block_of_pixels in pixelWidth
    Byte data[format-specific-number-of-bytes]**
    end
    end
    end
    Byte cubePadding[0-3]
    end
    end
    Byte mipPadding[3 - ((imageSize + 3) % 4)]
    end
    I found the PVRTexLib save incorrect KTX file that missed “UInt32 imageSize;” before every MIPMaps level compressed pixel data.
    Mali GPU Texture Compression Tool is corrected.
    Same issue with PVRTexTool GUI/CL.
    #36045

    Yikes, good catch!

    I’m not 100% why this hasn’t been noticed before but I’ll definitely fix this for the next release.

    If this is a blocking issue for you, if you email DevTech@imgtec.com I should be able to provide a version with the fix in. Otherwise the next release should be available within the next month or so.

    Thanks,

    Tobias

    #36046

    oiram
    Member

    I’ve mailed you already.

    Smile
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.