st/mesa: add support for GL core profiles
authorMarek Olšák <maraeo@gmail.com>
Fri, 23 Nov 2012 19:20:03 +0000 (20:20 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 29 Nov 2012 00:07:26 +0000 (01:07 +0100)
The rest of the plumbing was in place already.

I have tested this by turning on all GL 3.1 features.
The drivers not supporting GL 3.1 will fail to create a core profile
as they should.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/gallium/state_trackers/dri/common/dri_context.c
src/mesa/state_tracker/st_manager.c

index b91303d3e7bee68845606201b553cd1749d24d0f..360174b056d99192967452a0b93458c431dbbdc6 100644 (file)
@@ -82,7 +82,9 @@ dri_create_context(gl_api api, const struct gl_config * visual,
       attribs.profile = ST_PROFILE_OPENGL_ES2;
       break;
    case API_OPENGL:
-      attribs.profile = ST_PROFILE_DEFAULT;
+   case API_OPENGL_CORE:
+      attribs.profile = api == API_OPENGL ? ST_PROFILE_DEFAULT
+                                          : ST_PROFILE_OPENGL_CORE;
       attribs.major = major_version;
       attribs.minor = minor_version;
 
index 88b886de8a5351c4f17564b2bad4b153914c99be..999e916e92df050f9d2bad40d0cd4e908ccf547f 100644 (file)
@@ -624,6 +624,8 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
       api = API_OPENGLES2;
       break;
    case ST_PROFILE_OPENGL_CORE:
+      api = API_OPENGL_CORE;
+      break;
    default:
       *error = ST_CONTEXT_ERROR_BAD_API;
       return NULL;
@@ -884,6 +886,7 @@ static const struct st_api st_gl_api = {
    ST_API_OPENGL,
 #if FEATURE_GL
    ST_PROFILE_DEFAULT_MASK |
+   ST_PROFILE_OPENGL_CORE_MASK |
 #endif
 #if FEATURE_ES1
    ST_PROFILE_OPENGL_ES1_MASK |