summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/export/export.cpp6
-rw-r--r--platform/javascript/os_javascript.cpp47
2 files changed, 10 insertions, 43 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 6e1f7d749b..c44a0270ab 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -271,11 +271,9 @@ void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportP
String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name");
if (driver == "GLES2") {
r_features->push_back("etc");
- } else if (driver == "GLES3") {
+ } else if (driver == "Vulkan") {
+ // FIXME: Review if this is correct.
r_features->push_back("etc2");
- if (ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2")) {
- r_features->push_back("etc");
- }
}
}
}
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index f657ef483e..d22e53e7ea 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -32,7 +32,6 @@
#include "core/io/file_access_buffered_fa.h"
#include "drivers/gles2/rasterizer_gles2.h"
-#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "main/main.h"
@@ -825,8 +824,6 @@ int OS_JavaScript::get_video_driver_count() const {
const char *OS_JavaScript::get_video_driver_name(int p_driver) const {
switch (p_driver) {
- case VIDEO_DRIVER_GLES3:
- return "GLES3";
case VIDEO_DRIVER_GLES2:
return "GLES2";
}
@@ -908,41 +905,14 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
set_window_per_pixel_transparency_enabled(true);
}
- bool gles3 = true;
- if (p_video_driver == VIDEO_DRIVER_GLES2) {
- gles3 = false;
- }
-
bool gl_initialization_error = false;
- while (true) {
- if (gles3) {
- if (RasterizerGLES3::is_viable() == OK) {
- attributes.majorVersion = 2;
- RasterizerGLES3::register_config();
- RasterizerGLES3::make_current();
- break;
- } else {
- if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) {
- p_video_driver = VIDEO_DRIVER_GLES2;
- gles3 = false;
- continue;
- } else {
- gl_initialization_error = true;
- break;
- }
- }
- } else {
- if (RasterizerGLES2::is_viable() == OK) {
- attributes.majorVersion = 1;
- RasterizerGLES2::register_config();
- RasterizerGLES2::make_current();
- break;
- } else {
- gl_initialization_error = true;
- break;
- }
- }
+ if (RasterizerGLES2::is_viable() == OK) {
+ attributes.majorVersion = 1;
+ RasterizerGLES2::register_config();
+ RasterizerGLES2::make_current();
+ } else {
+ gl_initialization_error = true;
}
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(GODOT_CANVAS_SELECTOR, &attributes);
@@ -951,9 +921,8 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
}
if (gl_initialization_error) {
- OS::get_singleton()->alert("Your browser does not support any of the supported WebGL versions.\n"
- "Please update your browser version.",
- "Unable to initialize Video driver");
+ OS::get_singleton()->alert("Your browser does not seem to support WebGL. Please update your browser version.",
+ "Unable to initialize video driver");
return ERR_UNAVAILABLE;
}