-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
KTX2Loader: Fix transcode target choices for UASTC on iOS. Add BC7. #19846
Conversation
57c1ed3
to
a9a6027
Compare
What devices only support PVRTC? I thought all iOS devices support ETC2 as well. The real question is does the browser you are using support the WEBGL_compressed_texture_PVRTC extension. If it does not, try for the ETC2 or ASTC extensions instead. In fact ASTC, if available, should be the first choice when transcoding UASTC. |
iOS / Safari supports only PVRTC at this point. Not even ETC1. If you enable the experimental WebGL 2 flag you get more options (ASTC, ETC1, + ETC2 I think), but I'm not sure it works as advertised yet and haven't dug into that. Checked on an iPhone 11 with https://toji.github.io/texture-tester/. I am definitely sure the device supports PVRTC. Transcoding ETC1S to PVRTC works and renders fine. Transcoding UASTC to PVRTC fails completely — no data is returned, there is nothing to upload to the GPU. |
Recent iOS devices support ASTC and ETC, it's just Webkit doesn't expose the WebGL extensions. We have to wait until this issue is resolved: https://bugs.webkit.org/show_bug.cgi?id=198948. |
a9a6027
to
858a9bd
Compare
@MarkCallow thanks for the tip about power-of-two dimensions. This is working on iOS now. |
I should note that KTX2Loader does still fail when the experimental WebGL 2 option is enabled... as far as I can tell Safari then claims to support ASTC, but actually doesn't? ASTC is working on other devices, so I would like to think this will start working when Safari's WebGL 2 implementation is complete, and we can ignore the issue until then. If it turns out to be common for users to enable that experimental option, I guess we could resort to UserAgent sniffing. 😕 |
Thanks! |
Fixes Basis UASTC decoding on iOS. We were trying to transcode to PVRTC, which failed.
On devices that only support PVRTC, it seems like we can transcode ETC1S to PVRTC but UASTC must be decoded to RGBA32. @MarkCallow does that sound right? Or is that a temporary limitation in the transcoder?Transcoding to PVRTC requires that the texture have power of two dimensions.Excuse the extra logging, I'll clean that up shortly.Done.