dri: Move i965-specific context flag logic to dri common.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_context.c
index 18b8e573b598518d0abf383363cab952b6911171..5d5f41a32fe5e9d0fb16cf19ec4930a1b7ded0bb 100644 (file)
@@ -176,6 +176,7 @@ brw_initialize_context_constants(struct brw_context *brw)
       ctx->Const.MaxColorTextureSamples = 8;
       ctx->Const.MaxDepthTextureSamples = 8;
       ctx->Const.MaxIntegerSamples = 8;
+      ctx->Const.MaxProgramTextureGatherComponents = 4;
    }
 
    ctx->Const.MinLineWidth = 1.0;
@@ -275,7 +276,7 @@ brw_initialize_context_constants(struct brw_context *brw)
 }
 
 bool
-brwCreateContext(int api,
+brwCreateContext(gl_api api,
                 const struct gl_config *mesaVis,
                 __DRIcontext *driContextPriv,
                  unsigned major_version,
@@ -310,7 +311,7 @@ brwCreateContext(int api,
                           mesaVis, driContextPriv,
                          sharedContextPrivate, &functions,
                          error)) {
-      ralloc_free(brw);
+      intelDestroyContext(driContextPriv);
       return false;
    }
 
@@ -331,7 +332,7 @@ brwCreateContext(int api,
 
       if (!brw->hw_ctx) {
          fprintf(stderr, "Gen6+ requires Kernel 3.6 or later.\n");
-         ralloc_free(brw);
+         intelDestroyContext(driContextPriv);
          return false;
       }
    }
@@ -481,15 +482,7 @@ brwCreateContext(int api,
    brw->disable_derivative_optimization =
       driQueryOptionb(&brw->optionCache, "disable_derivative_optimization");
 
-   ctx->Const.ContextFlags = 0;
-   if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0)
-      ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
-
-   ctx->Debug.DebugOutput = GL_FALSE;
    if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) {
-      ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
-      ctx->Debug.DebugOutput = GL_TRUE;
-
       /* Turn on some extra GL_ARB_debug_output generation. */
       brw->perf_debug = true;
    }