Skip to content

Fix face bytelength calculation for PVRTC1 #390

@lexaknyazev

Description

@lexaknyazev

KTX-Software/lib/texture2.c

Lines 2018 to 2019 in 4e0a2ce

faceSize = blockCount.x * blockCount.y
* prtctd->_formatSize.blockSizeInBits / 8;

From the PVRTC1 spec:

For PVRTC 4BPP formats the imageSize is calculated as:
(max(width, 8) * max(height, 8) * 4 + 7) / 8
For PVRTC 2BPP formats the imageSize is calculated as:
(max(width, 16) * max(height, 8) * 2 + 7) / 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions