summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/enable.c9
-rw-r--r--src/mesa/main/errors.c3
-rw-r--r--src/mesa/main/mtypes.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 21e593117b3..5e2fd80d227 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -364,6 +364,11 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Test = state;
break;
+ case GL_DEBUG_OUTPUT:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ ctx->Debug.DebugOutput = state;
+ break;
case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum_error;
@@ -1201,6 +1206,10 @@ _mesa_IsEnabled( GLenum cap )
return ctx->Light.ColorMaterialEnabled;
case GL_CULL_FACE:
return ctx->Polygon.CullFlag;
+ case GL_DEBUG_OUTPUT:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ return ctx->Debug.DebugOutput;
case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum_error;
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index afe1affcf99..52fbadeb2dd 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -194,6 +194,9 @@ should_log(struct gl_context *ctx,
&ctx->Debug.Namespaces[gstack][source][type];
uintptr_t state;
+ if (!ctx->Debug.DebugOutput)
+ return GL_FALSE;
+
/* In addition to not being able to store zero as a value, HashTable also
can't use zero as a key. */
if (id)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 1747866aec8..5e68a779f8c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3392,6 +3392,7 @@ struct gl_debug_state
GLDEBUGPROC Callback;
const void *CallbackData;
GLboolean SyncOutput;
+ GLboolean DebugOutput;
GLboolean Defaults[MAX_DEBUG_GROUP_STACK_DEPTH][MESA_DEBUG_SEVERITY_COUNT][MESA_DEBUG_SOURCE_COUNT][MESA_DEBUG_TYPE_COUNT];
struct gl_debug_namespace Namespaces[MAX_DEBUG_GROUP_STACK_DEPTH][MESA_DEBUG_SOURCE_COUNT][MESA_DEBUG_TYPE_COUNT];
struct gl_debug_msg Log[MAX_DEBUG_LOGGED_MESSAGES];