Skip to content

Commit aea42fd

Browse files
Partially revert "Fix: update ANGLE and default binding to desktop"
Commit `fb75288` prevents MobileGlues GLSL conversion.
1 parent 03a557b commit aea42fd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Natives/ctxbridges/gl_bridge.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static bool gl_init() {
6161
EGL_ALPHA_SIZE, 8,
6262
EGL_DEPTH_SIZE, 24,
6363
EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT,
64-
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
64+
EGL_RENDERABLE_TYPE, angleDesktopGL ? EGL_OPENGL_BIT : EGL_OPENGL_ES3_BIT,
6565
EGL_NONE
6666
};
6767

@@ -82,8 +82,13 @@ static bool gl_init() {
8282
}
8383

8484
EGLBoolean bindResult;
85-
NSDebugLog(@"EGLBridge: Binding to desktop OpenGL (regardless of renderer)");
86-
bindResult = handle.eglBindAPI(EGL_OPENGL_API);
85+
if (angleDesktopGL) {
86+
NSDebugLog(@"EGLBridge: Binding to desktop OpenGL");
87+
bindResult = handle.eglBindAPI(EGL_OPENGL_API);
88+
} else {
89+
NSDebugLog(@"EGLBridge: Binding to OpenGL ES");
90+
bindResult = handle.eglBindAPI(EGL_OPENGL_ES_API);
91+
}
8792
if (!bindResult) NSDebugLog(@"EGLBridge: bind failed: %p\n", handle.eglGetError());
8893

8994
bundle->surface = handle.eglCreateWindowSurface(g_EglDisplay, bundle->config, (__bridge EGLNativeWindowType)SurfaceViewController.surface.layer, NULL);

0 commit comments

Comments
 (0)