Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store GLES over GL status in the OS to avoid direct renderer includes in the editor. #96525

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading