From 8e3b658b7fdc1c2a2b9b6bd942a811adbf1ac4ab Mon Sep 17 00:00:00 2001 From: nobled Date: Mon, 30 Aug 2010 20:23:54 +0000 Subject: st/dri: Add multi-api support Make st/dri screens capable of creating OpenGL ES and OpenGL ES2 contexts. TODO: Figure out the "get_current" problem with multiple st_api's for real. (s/API_OPENGLES1/API_OPENGLES/ by Chia-I Wu) --- src/gallium/state_trackers/dri/drm/dri2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/state_trackers/dri/drm') diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index 93f910a26d..7a56788184 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -439,6 +439,14 @@ dri2_init_screen(__DRIscreen * sPriv) if (!configs) goto fail; + sPriv->api_mask = 0; + if (screen->st_api[API_OPENGL]) + sPriv->api_mask |= 1 << __DRI_API_OPENGL; + if (screen->st_api[API_OPENGLES1]) + sPriv->api_mask |= 1 << __DRI_API_GLES; + if (screen->st_api[API_OPENGLES2]) + sPriv->api_mask |= 1 << __DRI_API_GLES2; + screen->auto_fake_front = dri_with_format(sPriv); screen->broken_invalidate = !sPriv->dri2.useInvalidate; -- cgit v1.2.3