diff --git a/gfx/context/drm_egl_ctx.c b/gfx/context/drm_egl_ctx.c index 89e5e1a92e..5accd9148f 100644 --- a/gfx/context/drm_egl_ctx.c +++ b/gfx/context/drm_egl_ctx.c @@ -805,7 +805,7 @@ static void gfx_ctx_bind_hw_render(void *data, bool enable) { (void)data; g_use_hw_ctx = enable; - if (g_egl_dpy) + if (g_egl_dpy && g_egl_surf) eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, enable ? g_egl_hw_ctx : g_egl_ctx); } diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index c2dd6ba027..f1fb9a0802 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -626,7 +626,7 @@ static void gfx_ctx_bind_hw_render(void *data, bool enable) (void)data; g_use_hw_ctx = enable; - if (g_dpy) + if (g_dpy && g_glx_win) { //RARCH_LOG("[GLX]: Binding context (%s): %p\n", enable ? "RetroArch" : "HW render", enable ? (void*)g_hw_ctx : (void*)g_ctx); glXMakeContextCurrent(g_dpy, g_glx_win, g_glx_win, enable ? g_hw_ctx : g_ctx); diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index ec8b1a7ede..01f792a13b 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -713,7 +713,7 @@ static void gfx_ctx_bind_hw_render(void *data, bool enable) { (void)data; g_use_hw_ctx = enable; - if (g_egl_dpy) + if (g_egl_dpy && g_egl_surf) eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, enable ? g_egl_hw_ctx : g_egl_ctx); }