From 3da08c9d9e2a2a0cfd0c6de681e6dcf0d750b1ce Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 30 Mar 2017 02:39:08 +0200 Subject: [PATCH] Cleanup egl_create_context --- gfx/common/egl_common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 4e530c8946..5c6addc9b1 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -238,13 +238,15 @@ bool egl_init_context(egl_ctx_data_t *egl, bool egl_create_context(egl_ctx_data_t *egl, const EGLint *egl_attribs) { - egl->ctx = eglCreateContext(egl->dpy, egl->config, EGL_NO_CONTEXT, + EGLContext ctx = eglCreateContext(egl->dpy, egl->config, EGL_NO_CONTEXT, egl_attribs); - egl->hw_ctx = NULL; - if (egl->ctx == EGL_NO_CONTEXT) + if (ctx == EGL_NO_CONTEXT) return false; + egl->ctx = ctx; + egl->hw_ctx = NULL; + if (egl->use_hw_ctx) { egl->hw_ctx = eglCreateContext(egl->dpy, egl->config, egl->ctx,