summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-09-26 17:17:06 -0700
committerKenneth Graunke <[email protected]>2013-10-13 00:10:43 -0700
commit95bd8a332d1c3f868d8e4ff454fb308acd9beed9 (patch)
tree3a0959ca85a5a580df5d96006967295de107db74 /src/mesa/drivers
parent5ceeeb360ea5d199263eeb20edc12a0f10b324cf (diff)
dri: Move i965-specific context flag logic to dri common.
Nobody else yet can do a forward context anyway, but others should be able to do debug contexts, and those would have just had no effect currently.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c9
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c8
2 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 32f0e33009f..db44eede651 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -47,6 +47,7 @@
#include "utils.h"
#include "xmlpool.h"
#include "../glsl/glsl_parser_extras.h"
+#include "main/mtypes.h"
#include "main/version.h"
#include "main/macros.h"
@@ -378,6 +379,14 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
return NULL;
}
+ struct gl_context *ctx = context->driverPrivate;
+ 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;
+ ctx->Debug.DebugOutput = GL_TRUE;
+ }
+
*error = __DRI_CTX_ERROR_SUCCESS;
return context;
}
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index c648d30cfaa..5d5f41a32fe 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -482,15 +482,7 @@ brwCreateContext(gl_api 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;
}