#define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 1024
/*@}*/
+/** For GL_ARB_debug_output */
+/*@{*/
+#define MAX_DEBUG_LOGGED_MESSAGES 10
+#define MAX_DEBUG_MESSAGE_LENGTH 4096
+/*@}*/
+
/*
* Color channel component order
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
_mesa_init_display_list( ctx );
+ _mesa_init_errors( ctx );
_mesa_init_eval( ctx );
_mesa_init_fbobjects( ctx );
_mesa_init_feedback( ctx );
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Test = state;
break;
+ case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
+ ctx->Debug.SyncOutput = state;
+ break;
case GL_DITHER:
if (ctx->Color.DitherFlag == state)
return;
return ctx->Light.ColorMaterialEnabled;
case GL_CULL_FACE:
return ctx->Polygon.CullFlag;
+ case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
+ return ctx->Debug.SyncOutput;
case GL_DEPTH_TEST:
return ctx->Depth.Test;
case GL_DITHER:
#include "version.h"
-#define MAXSTRING 4000 /* for _mesa_vsnprintf() */
+#define MAXSTRING MAX_DEBUG_MESSAGE_LENGTH
+
+void
+_mesa_init_errors(struct gl_context *ctx)
+{
+ ctx->Debug.Callback = NULL;
+ ctx->Debug.SyncOutput = GL_FALSE;
+ ctx->Debug.Log[0].length = 0;
+ ctx->Debug.NumMessages = 0;
+ ctx->Debug.NextMsg = 0;
+ ctx->Debug.NextMsgLength = 0;
+}
/**********************************************************************/
/** \name Diagnostics */
struct gl_context;
+extern void
+_mesa_init_errors( struct gl_context *ctx );
+
extern void
_mesa_warning( struct gl_context *gc, const char *fmtString, ... ) PRINTFLIKE(2, 3);
/* GL_ARB_robustness */
{ GL_RESET_NOTIFICATION_STRATEGY_ARB, CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA },
+
+ /* GL_ARB_debug_output */
+ { GL_DEBUG_LOGGED_MESSAGES_ARB, CONTEXT_INT(Debug.NumMessages), NO_EXTRA },
+ { GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB, CONTEXT_INT(Debug.NextMsgLength), NO_EXTRA },
+ { GL_MAX_DEBUG_LOGGED_MESSAGES_ARB, CONST(MAX_DEBUG_LOGGED_MESSAGES), NO_EXTRA },
+ { GL_MAX_DEBUG_MESSAGE_LENGTH_ARB, CONST(MAX_DEBUG_MESSAGE_LENGTH), NO_EXTRA },
+
#endif /* FEATURE_GL */
};
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr;
break;
#endif
+ case GL_DEBUG_CALLBACK_FUNCTION_ARB:
+ *params = (GLvoid *) ctx->Debug.Callback;
+ break;
+ case GL_DEBUG_CALLBACK_USER_PARAM_ARB:
+ *params = ctx->Debug.CallbackData;
+ break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
return;
} Current;
};
+/**
+ * An error, warning, or other piece of debug information for an application
+ * to consume via GL_ARB_debug_output.
+ */
+struct gl_debug_msg
+{
+ GLenum source;
+ GLenum type;
+ GLuint id;
+ GLenum severity;
+ GLsizei length;
+ GLcharARB *message;
+};
+
+/* GL_ARB_debug_output */
+struct gl_debug_state
+{
+ GLDEBUGPROCARB Callback;
+ GLvoid *CallbackData;
+ GLboolean SyncOutput;
+ struct gl_debug_msg Log[MAX_DEBUG_LOGGED_MESSAGES];
+ GLint NumMessages;
+ GLint NextMsg;
+ GLint NextMsgLength; /* redundant, but copied here from Log[NextMsg].length
+ for the sake of the offsetof() code in get.c */
+};
/**
* Enum for the OpenGL APIs we know about and may support.
const char *ErrorDebugFmtString;
GLuint ErrorDebugCount;
+ /* GL_ARB_debug_output */
+ struct gl_debug_state Debug;
+
GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLbitfield NewState; /**< bitwise-or of _NEW_* flags */