summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_context.c10
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_api.c24
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c7
-rw-r--r--src/gallium/state_trackers/vega/vg_manager.c11
-rw-r--r--src/gallium/state_trackers/wgl/stw_context.c7
5 files changed, 50 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index f9ebe1edcce..8948cfc2ccb 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -57,17 +57,21 @@ dri_create_context(gl_api api, const __GLcontextModes * visual,
struct st_api *stapi;
struct dri_context *ctx = NULL;
struct st_context_iface *st_share = NULL;
- struct st_visual stvis;
+ struct st_context_attribs attribs;
+ memset(&attribs, 0, sizeof(attribs));
switch (api) {
case API_OPENGL:
stapi = screen->st_api[ST_API_OPENGL];
+ attribs.profile = ST_PROFILE_DEFAULT;
break;
case API_OPENGLES:
stapi = screen->st_api[ST_API_OPENGL_ES1];
+ attribs.profile = ST_PROFILE_OPENGL_ES1;
break;
case API_OPENGLES2:
stapi = screen->st_api[ST_API_OPENGL_ES2];
+ attribs.profile = ST_PROFILE_OPENGL_ES2;
break;
default:
stapi = NULL;
@@ -92,8 +96,8 @@ dri_create_context(gl_api api, const __GLcontextModes * visual,
driParseConfigFiles(&ctx->optionCache,
&screen->optionCache, sPriv->myNum, "dri");
- dri_fill_st_visual(&stvis, screen, visual);
- ctx->st = stapi->create_context(stapi, &screen->base, &stvis, st_share);
+ dri_fill_st_visual(&attribs.visual, screen, visual);
+ ctx->st = stapi->create_context(stapi, &screen->base, &attribs, st_share);
if (ctx->st == NULL)
goto fail;
ctx->st->st_manager_private = (void *) ctx;
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index 3ec53653f44..cda46b8c301 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -43,7 +43,8 @@
* Return the state tracker for the given context.
*/
static struct st_api *
-egl_g3d_choose_st(_EGLDriver *drv, _EGLContext *ctx)
+egl_g3d_choose_st(_EGLDriver *drv, _EGLContext *ctx,
+ enum st_profile_type *profile)
{
struct egl_g3d_driver *gdrv = egl_g3d_driver(drv);
EGLint idx = -1;
@@ -74,6 +75,18 @@ egl_g3d_choose_st(_EGLDriver *drv, _EGLContext *ctx)
break;
}
+ switch (idx) {
+ case ST_API_OPENGL_ES1:
+ *profile = ST_PROFILE_OPENGL_ES1;
+ break;
+ case ST_API_OPENGL_ES2:
+ *profile = ST_PROFILE_OPENGL_ES2;
+ break;
+ default:
+ *profile = ST_PROFILE_DEFAULT;
+ break;
+ }
+
return (idx >= 0) ? gdrv->loader->get_st_api(idx) : NULL;
}
@@ -85,6 +98,7 @@ egl_g3d_create_context(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
struct egl_g3d_context *gshare = egl_g3d_context(share);
struct egl_g3d_config *gconf = egl_g3d_config(conf);
struct egl_g3d_context *gctx;
+ struct st_context_attribs stattribs;
gctx = CALLOC_STRUCT(egl_g3d_context);
if (!gctx) {
@@ -97,14 +111,18 @@ egl_g3d_create_context(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
return NULL;
}
- gctx->stapi = egl_g3d_choose_st(drv, &gctx->base);
+ memset(&stattribs, 0, sizeof(stattribs));
+ if (gconf)
+ stattribs.visual = gconf->stvis;
+
+ gctx->stapi = egl_g3d_choose_st(drv, &gctx->base, &stattribs.profile);
if (!gctx->stapi) {
FREE(gctx);
return NULL;
}
gctx->stctxi = gctx->stapi->create_context(gctx->stapi, gdpy->smapi,
- (gconf) ? &gconf->stvis : NULL, (gshare) ? gshare->stctxi : NULL);
+ &stattribs, (gshare) ? gshare->stctxi : NULL);
if (!gctx->stctxi) {
FREE(gctx);
return NULL;
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index eb4ce742669..36d63c30d6c 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -849,6 +849,7 @@ PUBLIC
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
XMesaDisplay xmdpy = xmesa_init_display(v->display);
+ struct st_context_attribs attribs;
XMesaContext c;
if (!xmdpy)
@@ -863,8 +864,12 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
c->xm_buffer = NULL; /* set later by XMesaMakeCurrent */
c->xm_read_buffer = NULL;
+ memset(&attribs, 0, sizeof(attribs));
+ attribs.profile = ST_PROFILE_DEFAULT;
+ attribs.visual = v->stvis;
+
c->st = stapi->create_context(stapi, xmdpy->smapi,
- &v->stvis, (share_list) ? share_list->st : NULL);
+ &attribs, (share_list) ? share_list->st : NULL);
if (c->st == NULL)
goto fail;
diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
index c2aa98b231c..e7996741d14 100644
--- a/src/gallium/state_trackers/vega/vg_manager.c
+++ b/src/gallium/state_trackers/vega/vg_manager.c
@@ -341,13 +341,20 @@ vg_context_destroy(struct st_context_iface *stctxi)
static struct st_context_iface *
vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
- const struct st_visual *visual,
+ const struct st_context_attribs *attribs,
struct st_context_iface *shared_stctxi)
{
struct vg_context *shared_ctx = (struct vg_context *) shared_stctxi;
struct vg_context *ctx;
struct pipe_context *pipe;
+ if (!(stapi->profile_mask & (1 << attribs->profile)))
+ return NULL;
+
+ /* only 1.0 is supported */
+ if (attribs->major != 1 || attribs->minor > 0)
+ return NULL;
+
pipe = smapi->screen->context_create(smapi->screen, NULL);
if (!pipe)
return NULL;
@@ -528,6 +535,8 @@ vg_api_destroy(struct st_api *stapi)
}
static const struct st_api vg_api = {
+ ST_API_OPENVG,
+ ST_PROFILE_DEFAULT_MASK,
vg_api_destroy,
vg_api_get_proc_address,
vg_api_create_context,
diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index a0e14b96016..85878b46730 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -129,6 +129,7 @@ DrvCreateLayerContext(
{
int iPixelFormat;
const struct stw_pixelformat_info *pfi;
+ struct st_context_attribs attribs;
struct stw_context *ctx = NULL;
if(!stw_dev)
@@ -150,8 +151,12 @@ DrvCreateLayerContext(
ctx->hdc = hdc;
ctx->iPixelFormat = iPixelFormat;
+ memset(&attribs, 0, sizeof(attribs));
+ attribs.profile = ST_PROFILE_DEFAULT;
+ attribs.visual = pfi->stvis;
+
ctx->st = stw_dev->stapi->create_context(stw_dev->stapi,
- stw_dev->smapi, &pfi->stvis, NULL);
+ stw_dev->smapi, &attribs, NULL);
if (ctx->st == NULL)
goto no_st_ctx;