From bb56b6c1c70f73560864458636a3a1d2169c358d Mon Sep 17 00:00:00 2001 From: Berstanio Date: Sun, 18 Aug 2024 16:52:10 +0200 Subject: [PATCH] fix: Use EGL_NO_CONFIG_KHR properly --- MetalANGLEKit/MGLContext.mm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/MetalANGLEKit/MGLContext.mm b/MetalANGLEKit/MGLContext.mm index 358806d..d439bad 100644 --- a/MetalANGLEKit/MGLContext.mm +++ b/MetalANGLEKit/MGLContext.mm @@ -64,21 +64,6 @@ void Throw(NSString *msg) EGLContext CreateEGLContext(EGLDisplay display, MGLRenderingAPI api, EGLContext sharedContext) { - // Init config - std::vector surfaceAttribs = { - EGL_RED_SIZE, EGL_DONT_CARE, EGL_GREEN_SIZE, EGL_DONT_CARE, - EGL_BLUE_SIZE, EGL_DONT_CARE, EGL_ALPHA_SIZE, EGL_DONT_CARE, - EGL_DEPTH_SIZE, EGL_DONT_CARE, EGL_STENCIL_SIZE, EGL_DONT_CARE, - EGL_SAMPLE_BUFFERS, EGL_DONT_CARE, EGL_SAMPLES, EGL_DONT_CARE, - }; - surfaceAttribs.push_back(EGL_NONE); - EGLConfig config; - EGLint numConfigs; - if (!eglChooseConfig(display, surfaceAttribs.data(), &config, 1, &numConfigs) || numConfigs < 1) - { - Throw(@"Failed to call eglChooseConfig()"); - } - // Init context int ctxMajorVersion = 2; int ctxMinorVersion = 0; @@ -102,7 +87,7 @@ EGLContext CreateEGLContext(EGLDisplay display, MGLRenderingAPI api, EGLContext EGLint ctxAttribs[] = {EGL_CONTEXT_MAJOR_VERSION, ctxMajorVersion, EGL_CONTEXT_MINOR_VERSION, ctxMinorVersion, EGL_NONE}; - EGLContext eglContext = eglCreateContext(display, config, sharedContext, ctxAttribs); + EGLContext eglContext = eglCreateContext(display, EGL_NO_CONFIG_KHR, sharedContext, ctxAttribs); if (eglContext == EGL_NO_CONTEXT) { Throw(@"Failed to call eglCreateContext()");