Mesa (master): st/mesa: allow forward-compatible contexts and set Const. ContextFlags
Marek Olšák
mareko at kemper.freedesktop.org
Thu Nov 29 00:08:35 UTC 2012
Module: Mesa
Branch: master
Commit: aa46cc2879846c7f4e11dfb0a83063863bce6997
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa46cc2879846c7f4e11dfb0a83063863bce6997
Author: Marek Olšák <maraeo at gmail.com>
Date: Wed Nov 28 20:38:22 2012 +0100
st/mesa: allow forward-compatible contexts and set Const.ContextFlags
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/gallium/include/state_tracker/st_api.h | 3 +--
src/mesa/state_tracker/st_manager.c | 12 +++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 3a11cd4..85de1c2 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -250,8 +250,7 @@ struct st_context_attribs
* The profile and minimal version to support.
*
* The valid profiles and versions are rendering API dependent. The latest
- * version satisfying the request should be returned, unless the
- * ST_CONTEXT_FLAG_FORWARD_COMPATIBLE bit is set.
+ * version satisfying the request should be returned.
*/
enum st_profile_type profile;
int major, minor;
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 999e916..5576a0d 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -646,16 +646,18 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
return NULL;
}
+ if (attribs->flags & ST_CONTEXT_FLAG_DEBUG)
+ st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
+ if (attribs->flags & ST_CONTEXT_FLAG_FORWARD_COMPATIBLE)
+ st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
+
/* need to perform version check */
if (attribs->major > 1 || attribs->minor > 0) {
_mesa_compute_version(st->ctx);
- /* Is the actual version less than the requested version? Mesa can't
- * yet enforce the added restrictions of a forward-looking context, so
- * fail that too.
+ /* Is the actual version less than the requested version?
*/
- if (st->ctx->Version < attribs->major * 10 + attribs->minor
- || (attribs->flags & ~ST_CONTEXT_FLAG_DEBUG) != 0) {
+ if (st->ctx->Version < attribs->major * 10 + attribs->minor) {
*error = ST_CONTEXT_ERROR_BAD_VERSION;
st_destroy_context(st);
return NULL;
More information about the mesa-commit
mailing list