Skip to content

Commit

Permalink
Merge pull request #96525 from bruvzg/rem_gl_renderer_incl
Browse files Browse the repository at this point in the history
Store GLES over GL status in the OS to avoid direct renderer includes in the editor.
  • Loading branch information
akien-mga committed Sep 4, 2024
2 parents 3e8ebb9 + d4e78b8 commit 906a4e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions core/os/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class OS {
int _display_driver_id = -1;
String _current_rendering_driver_name;
String _current_rendering_method;
bool _is_gles_over_gl = false;

RemoteFilesystemClient default_rfs;

Expand Down Expand Up @@ -130,9 +131,11 @@ class OS {

void set_current_rendering_driver_name(const String &p_driver_name) { _current_rendering_driver_name = p_driver_name; }
void set_current_rendering_method(const String &p_name) { _current_rendering_method = p_name; }
void set_gles_over_gl(bool p_enabled) { _is_gles_over_gl = p_enabled; }

String get_current_rendering_driver_name() const { return _current_rendering_driver_name; }
String get_current_rendering_method() const { return _current_rendering_method; }
bool get_gles_over_gl() const { return _is_gles_over_gl; }

int get_display_driver_id() const { return _display_driver_id; }

Expand Down
1 change: 1 addition & 0 deletions drivers/gles3/rasterizer_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class RasterizerGLES3 : public RendererCompositor {

static void make_current(bool p_gles_over_gl) {
gles_over_gl = p_gles_over_gl;
OS::get_singleton()->set_gles_over_gl(gles_over_gl);
_create_func = _create_current;
low_end = true;
}
Expand Down
8 changes: 1 addition & 7 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@

#include "modules/modules_enabled.gen.h" // For gdscript, mono.

#if defined(GLES3_ENABLED)
#include "drivers/gles3/rasterizer_gles3.h"
#endif

EditorNode *EditorNode::singleton = nullptr;

static const String EDITOR_NODE_CONFIG_SECTION = "EditorNode";
Expand Down Expand Up @@ -5062,18 +5058,16 @@ String EditorNode::_get_system_info() const {
driver_name = "Vulkan";
} else if (driver_name == "d3d12") {
driver_name = "Direct3D 12";
#if defined(GLES3_ENABLED)
} else if (driver_name == "opengl3_angle") {
driver_name = "OpenGL ES 3/ANGLE";
} else if (driver_name == "opengl3_es") {
driver_name = "OpenGL ES 3";
} else if (driver_name == "opengl3") {
if (RasterizerGLES3::is_gles_over_gl()) {
if (OS::get_singleton()->get_gles_over_gl()) {
driver_name = "OpenGL 3";
} else {
driver_name = "OpenGL ES 3";
}
#endif
} else if (driver_name == "metal") {
driver_name = "Metal";
}
Expand Down

0 comments on commit 906a4e9

Please sign in to comment.