[Mesa-dev] [PATCH 07/11] mesa: add message-toggle booleans for GL_ARB_debug_output
nobled
nobled at dreamwidth.org
Mon May 2 16:00:48 PDT 2011
---
src/mesa/main/errors.c | 2 +-
src/mesa/main/mtypes.h | 32 +++++++++++++++++++++++++++++++-
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index c953fbf..9d74a05 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -86,7 +86,7 @@ _mesa_log_msg(struct gl_context *ctx, GLenum source,
GLenum type,
emptySlot->length = strlen(out_of_memory)+1;
emptySlot->source = GL_DEBUG_SOURCE_OTHER_ARB;
emptySlot->type = GL_DEBUG_TYPE_ERROR_ARB;
- emptySlot->id = 1; /* TODO: proper id namespace */
+ emptySlot->id = OTHER_ERROR_OUT_OF_MEMORY;
emptySlot->severity = GL_DEBUG_SEVERITY_HIGH_ARB;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 647c1b7..41f6470 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3169,12 +3169,42 @@ struct gl_debug_msg
#define _MESA_MAX_DEBUG_LOGGED_MESSAGES 3
#define _MESA_MAX_DEBUG_MESSAGE_LENGTH 4096
-/* GL_ARB_debug_output */
+typedef enum {
+API_ERROR_UNKNOWN,
+
+API_ERROR_COUNT
+} ApiError;
+
+typedef enum {
+WINSYS_ERROR_UNKNOWN,
+
+WINSYS_ERROR_COUNT
+} WinsysError;
+
+typedef enum {
+SHADER_ERROR_UNKNOWN,
+
+SHADER_ERROR_COUNT
+} ShaderError;
+
+typedef enum {
+OTHER_ERROR_UNKNOWN,
+OTHER_ERROR_OUT_OF_MEMORY,
+
+OTHER_ERROR_COUNT
+} OtherError;
+
struct gl_debug_state
{
GLDEBUGPROCARB Callback;
GLvoid *CallbackData;
GLboolean SyncOutput;
+ GLboolean ApiErrors[API_ERROR_COUNT];
+ GLboolean WinsysErrors[WINSYS_ERROR_COUNT];
+ GLboolean ShaderErrors[SHADER_ERROR_COUNT];
+ GLboolean OtherErrors[OTHER_ERROR_COUNT];
+ /* TODO: Add an object here that tracks the state of client-provided IDs
+ in the APPLICATION and THIRD_PARTY namespaces. */
struct gl_debug_msg Log[_MESA_MAX_DEBUG_LOGGED_MESSAGES];
GLint NumMessages;
GLint NextMsg;
--
1.7.0.4
-------------- next part --------------
From 1cf98773f71c7f2eb0de1f844150755ebd605073 Mon Sep 17 00:00:00 2001
From: nobled <nobled at dreamwidth.org>
Date: Mon, 2 May 2011 17:43:38 +0000
Subject: [PATCH 07/10] mesa: add message-toggle booleans for GL_ARB_debug_output
---
src/mesa/main/errors.c | 2 +-
src/mesa/main/mtypes.h | 32 +++++++++++++++++++++++++++++++-
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index c953fbf..9d74a05 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -86,7 +86,7 @@ _mesa_log_msg(struct gl_context *ctx, GLenum source, GLenum type,
emptySlot->length = strlen(out_of_memory)+1;
emptySlot->source = GL_DEBUG_SOURCE_OTHER_ARB;
emptySlot->type = GL_DEBUG_TYPE_ERROR_ARB;
- emptySlot->id = 1; /* TODO: proper id namespace */
+ emptySlot->id = OTHER_ERROR_OUT_OF_MEMORY;
emptySlot->severity = GL_DEBUG_SEVERITY_HIGH_ARB;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 647c1b7..41f6470 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3169,12 +3169,42 @@ struct gl_debug_msg
#define _MESA_MAX_DEBUG_LOGGED_MESSAGES 3
#define _MESA_MAX_DEBUG_MESSAGE_LENGTH 4096
-/* GL_ARB_debug_output */
+typedef enum {
+API_ERROR_UNKNOWN,
+
+API_ERROR_COUNT
+} ApiError;
+
+typedef enum {
+WINSYS_ERROR_UNKNOWN,
+
+WINSYS_ERROR_COUNT
+} WinsysError;
+
+typedef enum {
+SHADER_ERROR_UNKNOWN,
+
+SHADER_ERROR_COUNT
+} ShaderError;
+
+typedef enum {
+OTHER_ERROR_UNKNOWN,
+OTHER_ERROR_OUT_OF_MEMORY,
+
+OTHER_ERROR_COUNT
+} OtherError;
+
struct gl_debug_state
{
GLDEBUGPROCARB Callback;
GLvoid *CallbackData;
GLboolean SyncOutput;
+ GLboolean ApiErrors[API_ERROR_COUNT];
+ GLboolean WinsysErrors[WINSYS_ERROR_COUNT];
+ GLboolean ShaderErrors[SHADER_ERROR_COUNT];
+ GLboolean OtherErrors[OTHER_ERROR_COUNT];
+ /* TODO: Add an object here that tracks the state of client-provided IDs
+ in the APPLICATION and THIRD_PARTY namespaces. */
struct gl_debug_msg Log[_MESA_MAX_DEBUG_LOGGED_MESSAGES];
GLint NumMessages;
GLint NextMsg;
--
1.7.0.4
More information about the mesa-dev
mailing list