Bug 229180 - [WebGL2] ETC1 texture is unable to upload using texStorage2D & compressTexSubImage2D
Summary: [WebGL2] ETC1 texture is unable to upload using texStorage2D & compressTexSub...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-16 23:59 PDT by Andrew
Modified: 2021-08-17 02:38 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2021-08-16 23:59:16 PDT
Hi!

We were trying to optimize texture upload for our HTML5 game and have discovered a bug on WebGL2:

This works for ETC1 textures:
gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGB_ETC1_WEBGL, width, height, 0, data);

This doesn't (but works fine for DXT or PVRTC textures where these formats are available):
gl.texStorage2D(gl.TEXTURE_2D, 1, ext.COMPRESSED_RGB_ETC1_WEBGL, width, height);
gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, ext.COMPRESSED_RGB_ETC1_WEBGL, data);

Reproduces on Android devices in Chrome and iOS 14 (enabled WebGL2 in Safari Settings menu).

Original WebGL1 texture tester with compressedTexImage2D (you can find ETC1 textures at the bottom of the page):
https://toji.github.io/texture-tester/

Our WebGL2 modified version of the tester with texStorage2D & compressedTexSubImage2D:
https://texstorage.fra1.digitaloceanspaces.com/index.html
Comment 1 Kimmo Kinnunen 2021-08-17 02:34:34 PDT
Thanks for the report!

As per the spec, it appears that compressedTexSubImage2D does not support COMPRESSED_RGB_ETC1_WEBGL

https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/

> Compression format COMPRESSED_RGB_ETC1_WEBGL may be passed to the compressedTexImage2D entry point. 

> Revision 5, 2014/03/07
> Remove ability to use the format with compressedTexSubImage2D, as per the GLES extension spec.

Closing this as invalid. If I've made a mistake, please reopen.
Comment 2 Kimmo Kinnunen 2021-08-17 02:38:08 PDT
Note, unexpectedly we don't return an error for the case. Bug 229182 tracks this omission.