diff options
author | Chia-I Wu <[email protected]> | 2010-09-10 10:31:06 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-09-10 15:37:43 +0800 |
commit | 4531356817ec8383ac35932903773de67af92e37 (patch) | |
tree | bb9c6262af2ca8261db6b0d325622d122ef04c70 /src/gallium/state_trackers/vega | |
parent | fcae8ca57512f84c51b7445456aab7ec92a21254 (diff) |
gallium: Add context profile support to st_api.
Add struct st_context_attribs to describe context profiles and
attributes. Modify st_api::create_context to take the new struct
instead of an st_visual.
st_context_attribs can be used to support GLX_ARB_create_context_profile
and GLX_EXT_create_context_es2_profile in the future. But the
motivation for doing it now is to be able to replace ST_API_OPENGL_ES1
and ST_API_OPENGL_ES2 by profiles.
Having 3 st_api's to provide OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is
not a sane abstraction, since all of them share glapi for current
context/dispatch management.
Diffstat (limited to 'src/gallium/state_trackers/vega')
-rw-r--r-- | src/gallium/state_trackers/vega/vg_manager.c | 11 |
1 files changed, 10 insertions, 1 deletions
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, |