summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd
diff options
context:
space:
mode:
authorSummersay415 <summersay415@gmail.com>2024-10-28 13:08:07 +0700
committerSummersay415 <summersay415@gmail.com>2024-10-28 22:57:19 +0700
commit6d14cd6ff96f74199acea2ad449ec2e1d2dcceab (patch)
tree4d068f9a0a16f66231a7d2b7a7d3b21fd1a5f65d /platform/linuxbsd
parenta3080477ac0421aef24ca0916c40559abbf4846b (diff)
downloadredot-engine-6d14cd6ff96f74199acea2ad449ec2e1d2dcceab.tar.gz
Fix fallbacks to OpenGL
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/wayland/display_server_wayland.cpp5
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp
index 0a87c4a517..d5271f9ad4 100644
--- a/platform/linuxbsd/wayland/display_server_wayland.cpp
+++ b/platform/linuxbsd/wayland/display_server_wayland.cpp
@@ -1356,13 +1356,16 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
if (rendering_context->initialize() != OK) {
memdelete(rendering_context);
rendering_context = nullptr;
+#if defined(GLES3_ENABLED)
bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
if (fallback_to_opengl3 && rendering_driver != "opengl3") {
WARN_PRINT("Your video card drivers seem not to support the required Vulkan version, switching to OpenGL 3.");
rendering_driver = "opengl3";
OS::get_singleton()->set_current_rendering_method("gl_compatibility");
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
- } else {
+ } else
+#endif // GLES3_ENABLED
+ {
r_error = ERR_CANT_CREATE;
if (p_rendering_driver == "vulkan") {
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index f1be5d83dc..48ff06cad2 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -6168,13 +6168,16 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
if (rendering_context->initialize() != OK) {
memdelete(rendering_context);
rendering_context = nullptr;
+#if defined(GLES3_ENABLED)
bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
if (fallback_to_opengl3 && rendering_driver != "opengl3") {
WARN_PRINT("Your video card drivers seem not to support the required Vulkan version, switching to OpenGL 3.");
rendering_driver = "opengl3";
OS::get_singleton()->set_current_rendering_method("gl_compatibility");
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
- } else {
+ } else
+#endif // GLES3_ENABLED
+ {
r_error = ERR_CANT_CREATE;
if (p_rendering_driver == "vulkan") {