From 5eeb06ffd1bf9cc79142760c372c17cd858cbe49 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 Feb 2019 11:58:47 -0300 Subject: -Remove harcoded opengl extension testing from OS, ask rasterizer instead. -Fixed a bug where etc textures were imported broken --- drivers/gles2/rasterizer_storage_gles2.cpp | 5 +++++ drivers/gles2/rasterizer_storage_gles2.h | 1 + 2 files changed, 6 insertions(+) (limited to 'drivers/gles2') 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; -- cgit v1.2.3