Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASTC size problem #29

Open
cloudwu opened this issue Aug 11, 2019 · 0 comments
Open

ASTC size problem #29

cloudwu opened this issue Aug 11, 2019 · 0 comments

Comments

@cloudwu
Copy link
Contributor

cloudwu commented Aug 11, 2019

When encoding a 256x256 n.png with astc6x6 format, the size is changed to 258x258 (for 6x6 alignment)

texturec -f n.png -o n.ktx -t astc6x6

And it may cause segment fault because of accessing memory beyond boundary. See #28 . My solution is not suitable, but I need a correct solution. Our tool chain is broken because of it.

I think the texturec should remain the original size (256x256) for astc6x6 format like astcenc.exe does ( https://github.com/ARM-software/astc-encoder/blob/master/Binary/windows-x64/astcenc.exe ) .

According to https://www.khronos.org/registry/OpenGL/extensions/OES/OES_texture_compression_astc.txt

For images which are not an integer multiple of the block size, additional texels are added to the edges with maximum X and Y (and Z for 3D textures). These texels may be any color, as they will not be accessed.

Although these are not all powers of two, it is possible to calculate block addresses and pixel addresses within the block, for legal image sizes, without undue complexity.

We may remain width 256 and height 256 in .ktx file header in this case. But now, it's 258.

@andrewwillmott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant