diff options
author | marha <marha@users.sourceforge.net> | 2011-02-04 16:28:55 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-04 16:28:55 +0000 |
commit | 5b7cc430132c47f9e4e84fd1830abc6aead39954 (patch) | |
tree | 4e2138ab7310c62b3f877b662d752d7c8c233f00 /mesalib/src/mesa/drivers/dri/common | |
parent | 573e5c4f462c3f97697f16388025a8e13469487c (diff) | |
parent | 39522c7dc587b335b0e0e00fc68f98e6a7a5c7bd (diff) | |
download | vcxsrv-5b7cc430132c47f9e4e84fd1830abc6aead39954.tar.gz vcxsrv-5b7cc430132c47f9e4e84fd1830abc6aead39954.tar.bz2 vcxsrv-5b7cc430132c47f9e4e84fd1830abc6aead39954.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/common')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/drisw_util.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/drisw_util.c b/mesalib/src/mesa/drivers/dri/common/drisw_util.c index 1529c23b1..1bdb6d893 100644 --- a/mesalib/src/mesa/drivers/dri/common/drisw_util.c +++ b/mesalib/src/mesa/drivers/dri/common/drisw_util.c @@ -121,6 +121,48 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, return pcp; } +static __DRIcontext * +driCreateNewContextForAPI(__DRIscreen *psp, int api, + const __DRIconfig *config, + __DRIcontext *shared, void *data) +{ + __DRIcontext *pcp; + void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL; + gl_api mesa_api; + + switch (api) { + case __DRI_API_OPENGL: + mesa_api = API_OPENGL; + break; + case __DRI_API_GLES: + mesa_api = API_OPENGLES; + break; + case __DRI_API_GLES2: + mesa_api = API_OPENGLES2; + break; + default: + return NULL; + } + + pcp = CALLOC_STRUCT(__DRIcontextRec); + if (!pcp) + return NULL; + + pcp->loaderPrivate = data; + + pcp->driScreenPriv = psp; + pcp->driDrawablePriv = NULL; + pcp->driReadablePriv = NULL; + + if (!driDriverAPI.CreateContext(mesa_api, + &config->modes, pcp, shareCtx)) { + FREE(pcp); + return NULL; + } + + return pcp; +} + static void driDestroyContext(__DRIcontext *pcp) { @@ -269,5 +311,6 @@ const __DRIcoreExtension driCoreExtension = { const __DRIswrastExtension driSWRastExtension = { { __DRI_SWRAST, __DRI_SWRAST_VERSION }, driCreateNewScreen, - driCreateNewDrawable + driCreateNewDrawable, + driCreateNewContextForAPI }; |