[Mesa-dev] [PATCH 01/15] mesa: Add some constants and state variables for KHR_debug functions

Timothy Arceri t_arceri at yahoo.com.au
Mon Aug 26 03:43:43 PDT 2013


Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
 src/mesa/main/config.h |    7 ++++++-
 src/mesa/main/errors.c |    4 ++++
 src/mesa/main/mtypes.h |   15 ++++++++++-----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 1d2ab4d..0bcf27c 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -249,12 +249,17 @@
 #define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS         1024
 /*@}*/
 
-/** For GL_ARB_debug_output */
+/** For GL_ARB_debug_output and GL_KHR_debug */
 /*@{*/
 #define MAX_DEBUG_LOGGED_MESSAGES   10
 #define MAX_DEBUG_MESSAGE_LENGTH    4096
 /*@}*/
 
+/** For GL_KHR_debug */
+/*@{*/
+#define MAX_LABEL_LENGTH 256
+#define MAX_DEBUG_GROUP_STACK_DEPTH 64
+/*@}*/
 
 /*
  * Color channel component order
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index cc93d3b..eea7291 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -66,12 +66,16 @@ static const GLenum debug_type_enums[] = {
    GL_DEBUG_TYPE_PORTABILITY,
    GL_DEBUG_TYPE_PERFORMANCE,
    GL_DEBUG_TYPE_OTHER,
+   GL_DEBUG_TYPE_MARKER,
+   GL_DEBUG_TYPE_PUSH_GROUP,
+   GL_DEBUG_TYPE_POP_GROUP,
 };
 
 static const GLenum debug_severity_enums[] = {
    GL_DEBUG_SEVERITY_LOW,
    GL_DEBUG_SEVERITY_MEDIUM,
    GL_DEBUG_SEVERITY_HIGH,
+   GL_DEBUG_SEVERITY_NOTIFICATION,
 };
 
 static enum mesa_debug_source
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 22bb58c..fd71fa7 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3315,8 +3315,8 @@ struct gl_dlist_state
 
 /** @{
  *
- * These are a mapping of the GL_ARB_debug_output enums to small enums
- * suitable for use as an array index.
+ * These are a mapping of the GL_ARB_debug_output/GL_KHR_debug enums
+ * to small enums suitable for use as an array index.
  */
 
 enum mesa_debug_source {
@@ -3336,6 +3336,9 @@ enum mesa_debug_type {
    MESA_DEBUG_TYPE_PORTABILITY,
    MESA_DEBUG_TYPE_PERFORMANCE,
    MESA_DEBUG_TYPE_OTHER,
+   MESA_DEBUG_TYPE_MARKER,
+   MESA_DEBUG_TYPE_PUSH_GROUP,
+   MESA_DEBUG_TYPE_POP_GROUP,
    MESA_DEBUG_TYPE_COUNT
 };
 
@@ -3343,6 +3346,7 @@ enum mesa_debug_severity {
    MESA_DEBUG_SEVERITY_LOW,
    MESA_DEBUG_SEVERITY_MEDIUM,
    MESA_DEBUG_SEVERITY_HIGH,
+   MESA_DEBUG_SEVERITY_NOTIFICATION,
    MESA_DEBUG_SEVERITY_COUNT
 };
 
@@ -3350,7 +3354,7 @@ enum mesa_debug_severity {
 
 /**
  * An error, warning, or other piece of debug information for an application
- * to consume via GL_ARB_debug_output.
+ * to consume via GL_ARB_debug_output/GL_KHR_debug.
  */
 struct gl_debug_msg
 {
@@ -3372,12 +3376,13 @@ struct gl_debug_namespace
 
 struct gl_debug_state
 {
-   GLDEBUGPROCARB Callback;
+   GLDEBUGPROC Callback;
    const void *CallbackData;
    GLboolean SyncOutput;
    GLboolean Defaults[MESA_DEBUG_SEVERITY_COUNT][MESA_DEBUG_SOURCE_COUNT][MESA_DEBUG_TYPE_COUNT];
    struct gl_debug_namespace Namespaces[MESA_DEBUG_SOURCE_COUNT][MESA_DEBUG_TYPE_COUNT];
    struct gl_debug_msg Log[MAX_DEBUG_LOGGED_MESSAGES];
+   GLint GroupStackDepth;
    GLint NumMessages;
    GLint NextMsg;
    GLint NextMsgLength; /* redundant, but copied here from Log[NextMsg].length
@@ -3624,7 +3629,7 @@ struct gl_context
    const char *ErrorDebugFmtString;
    GLuint ErrorDebugCount;
 
-   /* GL_ARB_debug_output */
+   /* GL_ARB_debug_output/GL_KHR_debug */
    struct gl_debug_state Debug;
 
    GLenum RenderMode;        /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
-- 
1.7.9.5



More information about the mesa-dev mailing list