Skip to content

Commit

Permalink
Merge pull request #84288 from bruvzg/angle_detect_2
Browse files Browse the repository at this point in the history
[macOS] Improve ANGLE support detection.
  • Loading branch information
akien-mga committed Nov 2, 2023
2 parents 44a54f4 + 4c74c7d commit 95b8a75
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions drivers/egl/egl_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ Error EGLManager::_gldisplay_create_context(GLDisplay &p_gldisplay) {
return OK;
}

Error EGLManager::open_display(void *p_display) {
int gldisplay_id = _get_gldisplay_id(p_display);
if (gldisplay_id < 0) {
return ERR_CANT_CREATE;
} else {
return OK;
}
}

int EGLManager::display_get_native_visual_id(void *p_display) {
int gldisplay_id = _get_gldisplay_id(p_display);
ERR_FAIL_COND_V(gldisplay_id < 0, ERR_CANT_CREATE);
Expand Down
1 change: 1 addition & 0 deletions drivers/egl/egl_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class EGLManager {
public:
int display_get_native_visual_id(void *p_display);

Error open_display(void *p_display);
Error window_create(DisplayServer::WindowID p_window_id, void *p_display, void *p_native_window, int p_width, int p_height);

void window_destroy(DisplayServer::WindowID p_window_id);
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4501,7 +4501,7 @@ - (void)popupAction:(id)sender {
#if defined(GLES3_ENABLED)
if (rendering_driver == "opengl3_angle") {
gl_manager_angle = memnew(GLManagerANGLE_MacOS);
if (gl_manager_angle->initialize() != OK) {
if (gl_manager_angle->initialize() != OK || gl_manager_angle->open_display(nullptr) != OK) {
memdelete(gl_manager_angle);
gl_manager_angle = nullptr;
bool fallback = GLOBAL_GET("rendering/gl_compatibility/fallback_to_native");
Expand Down

0 comments on commit 95b8a75

Please sign in to comment.