From 249f86e3f88d667437130a2badfe139d3144fcc9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 23 Nov 2012 20:20:03 +0100 Subject: [PATCH] st/mesa: add support for GL core profiles 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 Reviewed-by: Ian Romanick --- src/gallium/state_trackers/dri/common/dri_context.c | 4 +++- src/mesa/state_tracker/st_manager.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c index b91303d3e7b..360174b056d 100644 --- a/src/gallium/state_trackers/dri/common/dri_context.c +++ b/src/gallium/state_trackers/dri/common/dri_context.c @@ -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; diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 88b886de8a5..999e916e92d 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -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 | -- 2.30.2