i965: Set context flags
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 17 Aug 2012 16:32:59 +0000 (09:32 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:37 +0000 (15:09 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/intel/intel_screen.c

index f83f89f0481bde4b3db34406e1d9cf142acba892..8d2e5c99e08c3a725a3b17690ff17e3d90a07878 100644 (file)
@@ -77,6 +77,7 @@ brwCreateContext(int api,
                 __DRIcontext *driContextPriv,
                  unsigned major_version,
                  unsigned minor_version,
+                 uint32_t flags,
                  unsigned *error,
                 void *sharedContextPrivate)
 {
@@ -359,6 +360,13 @@ brwCreateContext(int api,
 
    ctx->Const.ForceGLSLExtensionsWarn = driQueryOptionb(&intel->optionCache, "force_glsl_extensions_warn");
 
+   ctx->Const.ContextFlags = 0;
+   if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0)
+      ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
+
+   if ((flags & __DRI_CTX_FLAG_DEBUG) != 0)
+      ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
+
    return true;
 }
 
index 15ef0a35d4f89e9efe3d87ccb5554b675fec06c7..71cd0f4ed8711816fec590549e930889d9cd7e30 100644 (file)
@@ -1101,6 +1101,7 @@ bool brwCreateContext(int api,
                      __DRIcontext *driContextPriv,
                       unsigned major_version,
                       unsigned minor_version,
+                      uint32_t flags,
                       unsigned *error,
                      void *sharedContextPrivate);
 
index ef5a87a94587e1920864b67fb27c5e1fa40d7359..26df77f469b155284521c9621ad6b477dcddedaf 100644 (file)
@@ -645,6 +645,7 @@ brwCreateContext(int api,
                 __DRIcontext *driContextPriv,
                  unsigned major_version,
                  unsigned minor_version,
+                 uint32_t flags,
                  unsigned *error,
                 void *sharedContextPrivate);
 
@@ -710,8 +711,8 @@ intelCreateContext(gl_api api,
 #else
    success = brwCreateContext(api, mesaVis,
                               driContextPriv,
-                              major_version, minor_version, error,
-                              sharedContextPrivate);
+                              major_version, minor_version, flags,
+                              error, sharedContextPrivate);
 #endif
 
    if (success) {