summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-12-29 02:06:12 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-01-14 21:08:22 +0100
commit40be15920f849100dbf5bf94a1d09e81bf05c6e4 (patch)
tree575410d96325f875e13b3a76c5eb4cde8fe0b6b5 /drivers/gles3
parent472b5b116742bbb1bdc8197c60efef57c7fd169f (diff)
Remove support for PVRTC texture encoding and decoding
On the only platform where PVRTC is supported (iOS), ETC2 generally supersedes PVRTC in every possible way. The increased memory usage is not really a problem thanks to modern iOS' devices processing power being higher than its Android counterparts.
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp76
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h1
2 files changed, 6 insertions, 71 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index db449b7a08..fd9e98be83 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -55,16 +55,6 @@ GLuint RasterizerStorageGLES3::system_fbo = 0;
#define _EXT_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
#define _EXT_ETC1_RGB8_OES 0x8D64
-#define _EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
-#define _EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
-#define _EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
-#define _EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
-
-#define _EXT_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
-#define _EXT_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
-#define _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
-#define _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
-
#define _EXT_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
#define _EXT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
@@ -312,57 +302,6 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_
need_decompress = true;
}
} break;
- case Image::FORMAT_PVRTC1_2: {
- if (config.pvrtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- r_gl_format = GL_RGBA;
- r_gl_type = GL_UNSIGNED_BYTE;
- r_compressed = true;
- //r_srgb = true;
-
- } else {
- need_decompress = true;
- }
- } break;
- case Image::FORMAT_PVRTC1_2A: {
- if (config.pvrtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
- r_gl_format = GL_RGBA;
- r_gl_type = GL_UNSIGNED_BYTE;
- r_compressed = true;
- //r_srgb = true;
-
- } else {
- need_decompress = true;
- }
-
- } break;
- case Image::FORMAT_PVRTC1_4: {
- if (config.pvrtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- r_gl_format = GL_RGBA;
- r_gl_type = GL_UNSIGNED_BYTE;
- r_compressed = true;
- //r_srgb = true;
-
- } else {
- need_decompress = true;
- }
-
- } break;
- case Image::FORMAT_PVRTC1_4A: {
- if (config.pvrtc_supported) {
- r_gl_internal_format = _EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- r_gl_format = GL_RGBA;
- r_gl_type = GL_UNSIGNED_BYTE;
- r_compressed = true;
- //r_srgb = true;
-
- } else {
- need_decompress = true;
- }
-
- } break;
case Image::FORMAT_ETC: {
if (config.etc_supported) {
r_gl_internal_format = _EXT_ETC1_RGB8_OES;
@@ -4085,17 +4024,17 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
}
bool RasterizerStorageGLES3::has_os_feature(const String &p_feature) const {
- if (p_feature == "pvrtc")
- return config.pvrtc_supported;
-
- if (p_feature == "s3tc")
+ if (p_feature == "s3tc") {
return config.s3tc_supported;
+ }
- if (p_feature == "etc")
+ if (p_feature == "etc") {
return config.etc_supported;
+ }
- if (p_feature == "skinning_fallback")
+ if (p_feature == "skinning_fallback") {
return config.use_skeleton_software;
+ }
return false;
}
@@ -4220,7 +4159,6 @@ void RasterizerStorageGLES3::initialize() {
#ifdef GLES_OVER_GL
config.float_texture_supported = true;
config.s3tc_supported = true;
- config.pvrtc_supported = false;
config.etc_supported = false;
config.support_npot_repeat_mipmap = true;
config.depth_buffer_internalformat = GL_DEPTH_COMPONENT24;
@@ -4228,7 +4166,6 @@ void RasterizerStorageGLES3::initialize() {
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.etc_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture") || config.extensions.has("WEBGL_compressed_texture_etc1");
- config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc") || config.extensions.has("WEBGL_compressed_texture_pvrtc");
config.support_npot_repeat_mipmap = config.extensions.has("GL_OES_texture_npot");
#ifdef JAVASCRIPT_ENABLED
@@ -4297,7 +4234,6 @@ void RasterizerStorageGLES3::initialize() {
config.etc_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture");
config.latc_supported = config.extensions.has("GL_EXT_texture_compression_latc");
config.bptc_supported = config.extensions.has("GL_ARB_texture_compression_bptc");
- config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc");
config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc") || config.extensions.has("EXT_texture_compression_rgtc");
config.bptc_supported = config.extensions.has("GL_ARB_texture_compression_bptc") || config.extensions.has("EXT_texture_compression_bptc");
config.srgb_decode_supported = config.extensions.has("GL_EXT_texture_sRGB_decode");
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index c080d28f94..4a4469d40a 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -79,7 +79,6 @@ public:
bool bptc_supported;
bool etc_supported;
bool etc2_supported;
- bool pvrtc_supported;
bool srgb_decode_supported;
bool keep_original_textures;