Open kotauskas opened 3 years ago
Yep the lib was created for ktx v1. I'd be open to merging PRs adding support for v2 in addition to the existing v1 support, or maybe this is an opportunity for a ktx2 crate? I don't currently have a strong opinion on it right now.
I feel like a mechanism to distinctly represent KTX 1.x and 2.0 and then abstract over them (something like a Ktx
trait) for parts where the downstream code doesn't care about the differences would be optimal. If KTX 3.0 ever becomes a thing, existing code would automatically account for newer format versions while still being able to extract just the information it needs.
I'm probably up to opening a PR implementing this design, since familiarizing myself with KTX 2.0 and the differences between it and 1.1 shouldn't be that hard, the specification isn't that long.
Maybe this could help? https://github.com/BVE-Reborn/ktx2
Currently, the implementation assumes a KTX version of 1.1 and fails to parse with a panic (not even an error — an unrecoverable panic) if the texture is a KTX 2.0 file. The latest KTX 2.0 specification is available here.