summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-02-26 11:58:47 -0300
committerJuan Linietsky <juan@godotengine.org>2019-02-26 11:58:47 -0300
commit5eeb06ffd1bf9cc79142760c372c17cd858cbe49 (patch)
tree824bdca6e0072ff877a1944c5b2c248c2bca0fbb /drivers/gles2
parent329904598829dcbed462b012dee39bc37d7d7c83 (diff)
-Remove harcoded opengl extension testing from OS, ask rasterizer instead.
-Fixed a bug where etc textures were imported broken
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp5
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 0acbb8cf51..db88339249 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -4922,6 +4922,9 @@ bool RasterizerStorageGLES2::free(RID p_rid) {
bool RasterizerStorageGLES2::has_os_feature(const String &p_feature) const {
+ if (p_feature == "pvrtc")
+ return config.pvrtc_supported;
+
if (p_feature == "s3tc")
return config.s3tc_supported;
@@ -4971,12 +4974,14 @@ void RasterizerStorageGLES2::initialize() {
#ifdef GLES_OVER_GL
config.float_texture_supported = true;
config.s3tc_supported = true;
+ config.pvrtc_supported = false;
config.etc1_supported = false;
config.support_npot_repeat_mipmap = true;
#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.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");
+ config.pvrtc_supported = config.extensions.has("IMG_texture_compression_pvrtc");
config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot");
#endif
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index 8e177ba57f..f6c8faa497 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -72,6 +72,7 @@ public:
bool float_texture_supported;
bool s3tc_supported;
bool etc1_supported;
+ bool pvrtc_supported;
bool keep_original_textures;