Merge pull request #84288 from bruvzg/angle_detect_2

[macOS] Improve ANGLE support detection.
This commit is contained in:
Rémi Verschelde 2023-11-02 09:11:55 +01:00
commit 95b8a75aaf
No known key found for this signature in database
GPG Key ID: C3336907360768E1
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");