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

PVRTC decoding: incorrect morton offset for non-square textures #61

Open
attilaz opened this issue Aug 3, 2021 · 2 comments
Open

PVRTC decoding: incorrect morton offset for non-square textures #61

attilaz opened this issue Aug 3, 2021 · 2 comments

Comments

@attilaz
Copy link
Contributor

attilaz commented Aug 3, 2021

Morton offset should take texture dimensions into account see reflectedMortonOffset function:

https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#_format_pvrtc1_4bpp

Current implementation https://github.com/bkaradzic/bimg/blob/master/src/image.cpp#L2973 causes crashes/incorrect textures for non-square textures.

I can send PR with the function in specs, but current implementation seems more optimized.

@bkaradzic
Copy link
Owner

Can you attach PVRTC texture that would crash?

@attilaz
Copy link
Contributor Author

attilaz commented Aug 5, 2021

I had a crash on windows with texturev.
crash

fractal.zip

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

2 participants