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,