summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri/common/dri_screen.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-09-10 13:23:06 +0800
committerChia-I Wu <olv@lunarg.com>2010-09-10 15:43:34 +0800
commit0cd480f07639ec9ee01424aaa3e0c900b2204d4f (patch)
tree087ec60a0a29ebe5ba747f6f13c43616dac687d8 /src/gallium/state_trackers/dri/common/dri_screen.c
parent4531356817ec8383ac35932903773de67af92e37 (diff)
st/dri: Use profiles to create OpenGL ES contexts.
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/dri/common/dri_screen.c')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 9d13d0d52e1..475a96d1967 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -344,12 +344,8 @@ dri_destroy_option_cache(struct dri_screen * screen)
void
dri_destroy_screen_helper(struct dri_screen * screen)
{
- int i;
-
- for (i = 0; i < ST_API_COUNT; i++) {
- if (screen->st_api[i] && screen->st_api[i]->destroy)
- screen->st_api[i]->destroy(screen->st_api[i]);
- }
+ if (screen->st_api && screen->st_api->destroy)
+ screen->st_api->destroy(screen->st_api);
if (screen->base.screen)
screen->base.screen->destroy(screen->base.screen);
@@ -383,14 +379,8 @@ dri_init_screen_helper(struct dri_screen *screen,
screen->base.get_egl_image = dri_get_egl_image;
screen->base.get_param = dri_get_param;
- screen->st_api[ST_API_OPENGL] = st_gl_api_create();
- screen->st_api[ST_API_OPENGL_ES1] = st_gl_api_create_es1();
- screen->st_api[ST_API_OPENGL_ES2] = st_gl_api_create_es2();
- /* no ST_API_OPENVG */
-
- if (!screen->st_api[ST_API_OPENGL] &&
- !screen->st_api[ST_API_OPENGL_ES1] &&
- !screen->st_api[ST_API_OPENGL_ES2])
+ screen->st_api = st_gl_api_create();
+ if (!screen->st_api)
return NULL;
if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))