emptySlot->id = id;
emptySlot->severity = severity;
} else {
+ static GLuint oom_msg_id = 0;
+ debug_get_id(&oom_msg_id);
+
/* malloc failed! */
emptySlot->message = out_of_memory;
emptySlot->length = strlen(out_of_memory)+1;
emptySlot->source = MESA_DEBUG_SOURCE_OTHER;
emptySlot->type = MESA_DEBUG_TYPE_ERROR;
- emptySlot->id = OTHER_ERROR_OUT_OF_MEMORY;
+ emptySlot->id = oom_msg_id;
emptySlot->severity = MESA_DEBUG_SEVERITY_HIGH;
}
return;
}
- source = gl_enum_to_debug_severity(gl_source);
- type = gl_enum_to_debug_severity(gl_type);
+ source = gl_enum_to_debug_source(gl_source);
+ type = gl_enum_to_debug_type(gl_type);
severity = gl_enum_to_debug_severity(gl_severity);
control_app_messages(ctx, source, type, severity, count, ids, enabled);
_mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
va_end( args );
fprintf(stderr, "Mesa %s implementation error: %s\n",
- MESA_VERSION_STRING, str);
+ PACKAGE_VERSION, str);
fprintf(stderr, "Please report at bugs.freedesktop.org\n");
}
}
_mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
{
GLboolean do_output, do_log;
+ /* Ideally this would be set up by the caller, so that we had proper IDs
+ * per different message.
+ */
+ static GLuint error_msg_id = 0;
+
+ debug_get_id(&error_msg_id);
do_output = should_output(ctx, error, fmtString);
do_log = should_log(ctx,
MESA_DEBUG_SOURCE_API,
MESA_DEBUG_TYPE_ERROR,
- API_ERROR_UNKNOWN,
+ error_msg_id,
MESA_DEBUG_SEVERITY_HIGH);
if (do_output || do_log) {
_mesa_log_msg(ctx,
MESA_DEBUG_SOURCE_API,
MESA_DEBUG_TYPE_ERROR,
- API_ERROR_UNKNOWN,
+ error_msg_id,
MESA_DEBUG_SEVERITY_HIGH, len, s2);
}
}
* \param len The length of 'msg'. If negative, 'msg' must be null-terminated.
*/
void
-_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint id,
+_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg, int len )
{
enum mesa_debug_source source = MESA_DEBUG_SOURCE_SHADER_COMPILER;
enum mesa_debug_severity severity = MESA_DEBUG_SEVERITY_HIGH;
+ debug_get_id(id);
+
if (len < 0)
len = strlen(msg);
if (len >= MAX_DEBUG_MESSAGE_LENGTH)
len = MAX_DEBUG_MESSAGE_LENGTH - 1;
- _mesa_log_msg(ctx, source, type, id, severity, len, msg);
+ _mesa_log_msg(ctx, source, type, *id, severity, len, msg);
}
/*@}*/