[macOS] Improve ANGLE support detection.

Try opening EGL display when checking if ANGLE is supported.
This commit is contained in:
bruvzg 2023-11-01 08:34:35 +02:00
parent 6afd320984
commit 4c74c7d11a
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38
3 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -92,6 +92,7 @@ private:
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);

View File

@ -4501,7 +4501,7 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM
#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");