Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

WebGL: Check for ETC2 compression support

BlueCube3310460f0471167b
diff --git a/drivers/gles3/storage/config.cpp b/drivers/gles3/storage/config.cpp
index c8308575249..57fec3ec75a 100644
--- a/drivers/gles3/storage/config.cpp
+++ b/drivers/gles3/storage/config.cpp
@@ -101,7 +101,11 @@ Config::Config() {
} else {
float_texture_supported = extensions.has("GL_EXT_color_buffer_float");
float_texture_linear_supported = extensions.has("GL_OES_texture_float_linear");
+#ifdef WEB_ENABLED
+ etc2_supported = extensions.has("WEBGL_compressed_texture_etc");
+#else
etc2_supported = true;
+#endif
#if defined(ANDROID_ENABLED) || defined(IOS_ENABLED)
// Some Android devices report support for S3TC but we don't expect that and don't export the textures.
// This could be fixed but so few devices support it that it doesn't seem useful (and makes bigger APKs).