mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(drm_egl_ctx.c) Start using egl_create_context
This commit is contained in:
parent
c1e61f7ff0
commit
033e0ac3ad
@ -204,3 +204,24 @@ bool egl_init_context(NativeDisplayType display,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool egl_create_context(EGLint *attr, EGLint *egl_attribs)
|
||||
{
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, EGL_NO_CONTEXT,
|
||||
(attr != egl_attribs) ? egl_attribs : NULL);
|
||||
|
||||
if (g_egl_ctx == EGL_NO_CONTEXT)
|
||||
return false;
|
||||
|
||||
if (g_use_hw_ctx)
|
||||
{
|
||||
g_egl_hw_ctx = eglCreateContext(g_egl_dpy, g_egl_config, g_egl_ctx,
|
||||
(attr != egl_attribs) ? egl_attribs : NULL);
|
||||
RARCH_LOG("[EGL]: Created shared context: %p.\n", (void*)g_egl_hw_ctx);
|
||||
|
||||
if (g_egl_hw_ctx == EGL_NO_CONTEXT)
|
||||
return false;;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -55,4 +55,6 @@ bool egl_init_context(NativeDisplayType display,
|
||||
EGLint *major, EGLint *minor,
|
||||
EGLint *n, const EGLint *attrib_ptr);
|
||||
|
||||
bool egl_create_context(EGLint *attr, EGLint *egl_attribs);
|
||||
|
||||
#endif
|
||||
|
@ -731,20 +731,10 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data,
|
||||
|
||||
attr = egl_fill_attribs(egl_attribs);
|
||||
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, EGL_NO_CONTEXT,
|
||||
attr != egl_attribs ? egl_attribs : NULL);
|
||||
|
||||
if (g_egl_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
|
||||
if (g_use_hw_ctx)
|
||||
if (!egl_create_context(attr, &egl_attribs[0]))
|
||||
{
|
||||
g_egl_hw_ctx = eglCreateContext(g_egl_dpy, g_egl_config, g_egl_ctx,
|
||||
attr != egl_attribs ? egl_attribs : NULL);
|
||||
RARCH_LOG("[KMS/EGL]: Created shared context: %p.\n", (void*)g_egl_hw_ctx);
|
||||
|
||||
if (g_egl_hw_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy,
|
||||
|
Loading…
x
Reference in New Issue
Block a user