summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/storage/config.cpp')
-rw-r--r--drivers/gles3/storage/config.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gles3/storage/config.cpp b/drivers/gles3/storage/config.cpp
index 1a14902c7c..2b3c19dbb8 100644
--- a/drivers/gles3/storage/config.cpp
+++ b/drivers/gles3/storage/config.cpp
@@ -35,6 +35,10 @@
#include "../rasterizer_gles3.h"
#include "texture_storage.h"
+#ifdef WEB_ENABLED
+#include <emscripten/html5_webgl.h>
+#endif
+
using namespace GLES3;
#define _GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
@@ -44,6 +48,23 @@ Config *Config::singleton = nullptr;
Config::Config() {
singleton = this;
+#ifdef WEB_ENABLED
+ // Starting with Emscripten 3.1.51, glGetStringi(GL_EXTENSIONS, i) will only ever return
+ // a fixed list of extensions, regardless of what additional extensions are enabled. This
+ // isn't very useful for us in determining which extensions we can rely on here. So, instead
+ // we use emscripten_webgl_get_supported_extensions() to get all supported extensions, which
+ // is what Emscripten 3.1.50 and earlier do.
+ {
+ char *extension_array_string = emscripten_webgl_get_supported_extensions();
+ PackedStringArray extension_array = String((const char *)extension_array_string).split(" ");
+ extensions.reserve(extension_array.size() * 2);
+ for (const String &s : extension_array) {
+ extensions.insert(s);
+ extensions.insert("GL_" + s);
+ }
+ free(extension_array_string);
+ }
+#else
{
GLint max_extensions = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &max_extensions);
@@ -55,6 +76,7 @@ Config::Config() {
extensions.insert((const char *)s);
}
}
+#endif
bptc_supported = extensions.has("GL_ARB_texture_compression_bptc") || extensions.has("EXT_texture_compression_bptc");
astc_supported = extensions.has("GL_KHR_texture_compression_astc") || extensions.has("GL_OES_texture_compression_astc") || extensions.has("GL_KHR_texture_compression_astc_ldr") || extensions.has("GL_KHR_texture_compression_astc_hdr");
@@ -196,6 +218,8 @@ Config::Config() {
//https://github.com/godotengine/godot/issues/92662#issuecomment-2161199477
//disable_particles_workaround = false;
}
+ } else if (rendering_device_name == "PowerVR Rogue GE8320") {
+ disable_transform_feedback_shader_cache = true;
}
}