From bf01cdf823ea882deeb4a7b0577bfecbb6c20bbd Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 14 Nov 2025 20:04:54 +0100 Subject: [PATCH] Reapply "Prefer GL3 driver over legacy GL driver" This reverts commit 0fa56a9f7cea01c48992fc3a2e37642a42b42832. --- .github/workflows/lua.yml | 4 ++-- builtin/settingtypes.txt | 2 +- irr/README.md | 6 +++--- irr/src/CMakeLists.txt | 12 ++++-------- src/client/renderingengine.cpp | 8 ++++---- src/defaultsettings.cpp | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index 0816c3957..ffd97236a 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -37,9 +37,9 @@ jobs: run: | serverconf="profiler.load=true" ./util/test_multiplayer.sh - - name: Singleplayer test + - name: Singleplayer test (legacy GL) run: | - xvfb-run ./util/test_singleplayer.sh + clientconf="video_driver=opengl" xvfb-run ./util/test_singleplayer.sh luacheck: name: "Builtin Luacheck and Unit Tests" diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 668daca48..7a8059233 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -2006,7 +2006,7 @@ shader_path (Shader path) path # The rendering back-end. # Note: A restart is required after changing this! -# OpenGL is the default for desktop, and OGLES2 for Android. +# By default OpenGL3 is preferred on desktop, or OGLES2 on Android. video_driver (Video driver) enum ,opengl,opengl3,ogles2 # Distance in nodes at which transparency depth sorting is enabled. diff --git a/irr/README.md b/irr/README.md index 507b8c539..ad4071778 100644 --- a/irr/README.md +++ b/irr/README.md @@ -12,12 +12,12 @@ The build system is CMake. The following libraries are required to be installed: * zlib, libPNG, libJPEG - * OpenGL - * or on mobile: OpenGL ES (can be optionally enabled on desktop too) + * OpenGL or OpenGL ES + * a headless build is possible, but not very useful * SDL2 or SDL3 (see below) Aside from standard search options (`ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY`, ...) the following options are available: - * `ENABLE_OPENGL` - Enable OpenGL driver + * `ENABLE_OPENGL` - Enable legacy OpenGL driver * `ENABLE_OPENGL3` - Enable OpenGL 3+ driver * `ENABLE_GLES2` - Enable OpenGL ES 2+ driver * `USE_SDL3` (default: `OFF`) - Use the SDL3 device instead of SDL2 (**experimental**) diff --git a/irr/src/CMakeLists.txt b/irr/src/CMakeLists.txt index ee9964c0b..4a6eba525 100644 --- a/irr/src/CMakeLists.txt +++ b/irr/src/CMakeLists.txt @@ -104,7 +104,7 @@ option(ENABLE_OPENGL3 "Enable OpenGL 3+" ${DEFAULT_OPENGL3}) if(ANDROID OR EMSCRIPTEN) set(ENABLE_OPENGL FALSE) else() - option(ENABLE_OPENGL "Enable OpenGL" TRUE) + option(ENABLE_OPENGL "Enable legacy OpenGL" TRUE) endif() if(APPLE) @@ -148,13 +148,9 @@ endif() # Configuration report -message(STATUS "OpenGL: ${ENABLE_OPENGL}") +message(STATUS "OpenGL (legacy): ${ENABLE_OPENGL}") message(STATUS "OpenGL 3: ${ENABLE_OPENGL3}") -if (ENABLE_GLES2) - message(STATUS "OpenGL ES 2: ON (unified)") -else() - message(STATUS "OpenGL ES 2: OFF") -endif() +message(STATUS "OpenGL ES 2: ${ENABLE_GLES2}") #message(STATUS "WebGL: ${ENABLE_WEBGL1}") # Required libs @@ -297,7 +293,7 @@ set(IRRDRVROBJ mt_opengl_loader.cpp ) -# the two legacy drivers +# the legacy driver if(ENABLE_OPENGL) set(IRRDRVROBJ diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index c0e8c05b1..dac81c7ca 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -376,8 +376,8 @@ std::vector RenderingEngine::getSupportedVideoDrivers() // Only check these drivers. We do not support software and D3D in any capacity. // ordered by preference (best first) static const video::E_DRIVER_TYPE glDrivers[] = { - video::EDT_OPENGL, video::EDT_OPENGL3, + video::EDT_OPENGL, video::EDT_OGLES2, video::EDT_NULL, }; @@ -411,10 +411,10 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud, const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(video::E_DRIVER_TYPE type) { static const std::unordered_map driver_info_map = { - {(int)video::EDT_NULL, {"null", "NULL Driver"}}, - {(int)video::EDT_OPENGL, {"opengl", "OpenGL"}}, + {(int)video::EDT_NULL, {"null", "NULL Driver"}}, + {(int)video::EDT_OPENGL, {"opengl", "OpenGL (legacy)"}}, {(int)video::EDT_OPENGL3, {"opengl3", "OpenGL 3+"}}, - {(int)video::EDT_OGLES2, {"ogles2", "OpenGL ES2"}}, + {(int)video::EDT_OGLES2, {"ogles2", "OpenGL ES 2"}}, }; return driver_info_map.at((int)type); } diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index dddee1591..7ec7878e3 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -308,7 +308,7 @@ void set_default_settings() // Effects settings->setDefault("enable_post_processing", "true"); - settings->setDefault("post_processing_texture_bits", "16"); + settings->setDefault("post_processing_texture_bits", "10"); settings->setDefault("directional_colored_fog", "true"); settings->setDefault("inventory_items_animations", "false"); settings->setDefault("mip_map", "false");