mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
egl: prototype some multi-API code
This commit is contained in:
parent
b98ac1d472
commit
4ebfc3c8ff
1 changed files with 19 additions and 10 deletions
|
|
@ -313,19 +313,21 @@ xlib_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||||
return EGL_NO_CONTEXT;
|
return EGL_NO_CONTEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Base.ClientAPI != EGL_OPENGL_API) {
|
/* API-dependent context creation */
|
||||||
_eglError(EGL_BAD_MATCH, "eglCreateContext(only OpenGL API supported)");
|
switch (ctx->Base.ClientAPI) {
|
||||||
|
case EGL_OPENGL_API:
|
||||||
|
/* create a softpipe context */
|
||||||
|
ctx->pipe = softpipe_create(xdrv->screen, xdrv->winsys, NULL);
|
||||||
|
/* Now do xlib / state tracker inits here */
|
||||||
|
_eglConfigToContextModesRec(conf, &visual);
|
||||||
|
ctx->Context = st_create_context(ctx->pipe, &visual, share_ctx);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_eglError(EGL_BAD_MATCH, "eglCreateContext(unsupported API)");
|
||||||
free(ctx);
|
free(ctx);
|
||||||
return EGL_NO_CONTEXT;
|
return EGL_NO_CONTEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a softpipe context */
|
|
||||||
ctx->pipe = softpipe_create(xdrv->screen, xdrv->winsys, NULL);
|
|
||||||
|
|
||||||
/* Now do xlib / state tracker inits here */
|
|
||||||
_eglConfigToContextModesRec(conf, &visual);
|
|
||||||
ctx->Context = st_create_context(ctx->pipe, &visual, share_ctx);
|
|
||||||
|
|
||||||
_eglSaveContext(&ctx->Base);
|
_eglSaveContext(&ctx->Base);
|
||||||
|
|
||||||
return _eglGetContextHandle(&ctx->Base);
|
return _eglGetContextHandle(&ctx->Base);
|
||||||
|
|
@ -341,7 +343,14 @@ xlib_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx)
|
||||||
context->Base.DeletePending = EGL_TRUE;
|
context->Base.DeletePending = EGL_TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
st_destroy_context(context->Context);
|
/* API-dependent clean-up */
|
||||||
|
switch (context->Base.ClientAPI) {
|
||||||
|
case EGL_OPENGL_API:
|
||||||
|
st_destroy_context(context->Context);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
free(context);
|
free(context);
|
||||||
}
|
}
|
||||||
return EGL_TRUE;
|
return EGL_TRUE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue