summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-27 09:41:50 +0100
committerGitHub <noreply@github.com>2019-01-27 09:41:50 +0100
commite3210040984acc69ddc236e25bd05c6e52a59583 (patch)
tree62ab33cdb7a605c0116da23d0009ee576dfa6ed2
parent1253b9c038277aebfb5a4cc11685823f2331a26b (diff)
parentd1e399a971a2e8058c4890ec9014275526c26421 (diff)
Merge pull request #25356 from muiroc/bug_web_comp_tex
Fix S3TC texture loading for WebGL
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 38fcff3ab2..0f52a02363 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -195,11 +195,11 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_
} break;
case Image::FORMAT_DXT1: {
- r_compressed = true;
if (config.s3tc_supported) {
r_gl_internal_format = _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT;
r_gl_format = GL_RGBA;
r_gl_type = GL_UNSIGNED_BYTE;
+ r_compressed = true;
} else {
need_decompress = true;
}
@@ -4868,8 +4868,8 @@ void RasterizerStorageGLES2::initialize() {
config.etc1_supported = false;
#else
config.float_texture_supported = config.extensions.has("GL_ARB_texture_float") || config.extensions.has("GL_OES_texture_float");
- config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc");
- config.etc1_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture");
+ config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
+ config.etc1_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture") || config.extensions.has("WEBGL_compressed_texture_etc1");
#endif
#ifdef GLES_OVER_GL
config.use_rgba_2d_shadows = false;