Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Near-infinite compression time on some textures. #46

@jitspoe

Description

@jitspoe

The Godot engine is using this, and there's some code in EtcBlock4x4Encoding_RGB8.cpp and EtcBlock4x4Encoding_RGB8A1.cpp that has multiple loops with very large values.

iMaxRed2 = 252645152, iMaxGreen2 = 252645152, iMaxBlue2 = 252645152

            for (int iRed2 = iMinRed2; iRed2 <= iMaxRed2; iRed2++)
            {
                for (int iGreen2 = iMinGreen2; iGreen2 <= iMaxGreen2; iGreen2++)
                {
                    for (int iBlue2 = iMinBlue2; iBlue2 <= iMaxBlue2; iBlue2++)
                    {

After several minutes iRed2 was only at 15/252645152. I've attached the file I was trying to import:

water_normals2

Importing just the red and green channels is fine, but importing all of them results in a near-infinite loop.

This code looks suspect, but I'm not sure if that's by design or not:

		int iMaxRed2 = iColor2Red + (int)a_uiRadius;
		if (iMaxRed2 > 15)
		{
			iMinRed2 = 15;
		}

Several if statements check the max value, then set the min value. Should they be setting the max value to 15 instead?

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