-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
WebGL2: Fix 2D array textures with RGTC compression not rendering #101909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
WebGL uses the Compare that to the
Edit: The plot thickens. The RGTC extension says that it is basically just |
On an unrelated note, it would be interesting to look into properly supporting ASTC in the web. I think all we need to do is check for |
@@ -1509,8 +1509,19 @@ void TextureStorage::_texture_set_data(RID p_texture, const Ref<Image> &p_image, | |||
GLenum internal_format; | |||
bool compressed = false; | |||
|
|||
bool needs_decompress = texture->resize_to_po2; | |||
|
|||
#ifdef WEB_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking into it, this seems to be true for all GLES3 contexts since they rely on EXT_texture_compression_rgtc
which explicitly does not support 3D textures.
Therefore, I think this needs to use is_gles_over_gl()
instead to capture any time we use a GLES3 context (i.e. web, mobile, and ANGLE on desktop).
I am not 100% sure about ANGLE on desktop though, it might work anyway despite not being guaranteed by the spec
3280813
to
2221f6e
Compare
Added in #101932 |
Thanks! |
Fixes #101711
WebGL2 seemingly doesn't support 2D array RGTC-compressed textures (though it's not documented anywhere). This PR makes it so that under WebGL2 layered textures with RGTC compression are decompressed before being used.
The memory usage increase shouldn't be too significant, since the decompressed images only use either 1 or 2 color channels, so they will be twice as big (8 bytes vs 16 for RGTC_R and 16 bytes vs 32 for RGTC_RG)