'id' is the implementation-defined ID of the given message. */
static void
_mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
- GLenum type, GLuint id, const char *fmt, va_list ap)
+ GLenum type, const char *fmt, va_list ap)
{
- bool error = (type == GL_DEBUG_TYPE_ERROR_ARB);
+ bool error = (type == MESA_DEBUG_TYPE_ERROR);
+ GLuint msg_id = 0;
assert(state->info_log != NULL);
const char *const msg = &state->info_log[msg_offset];
struct gl_context *ctx = state->ctx;
+
/* Report the error via GL_ARB_debug_output. */
- if (error)
- _mesa_shader_debug(ctx, type, id, msg, strlen(msg));
+ _mesa_shader_debug(ctx, type, &msg_id, msg, strlen(msg));
ralloc_strcat(&state->info_log, "\n");
}
const char *fmt, ...)
{
va_list ap;
- GLenum type = GL_DEBUG_TYPE_ERROR_ARB;
state->error = true;
va_start(ap, fmt);
- _mesa_glsl_msg(locp, state, type, SHADER_ERROR_UNKNOWN, fmt, ap);
+ _mesa_glsl_msg(locp, state, MESA_DEBUG_TYPE_ERROR, fmt, ap);
va_end(ap);
}
const char *fmt, ...)
{
va_list ap;
- GLenum type = GL_DEBUG_TYPE_OTHER_ARB;
va_start(ap, fmt);
- _mesa_glsl_msg(locp, state, type, 0, fmt, ap);
+ _mesa_glsl_msg(locp, state, MESA_DEBUG_TYPE_OTHER, fmt, ap);
va_end(ap);
}
}
void
-_mesa_shader_debug(struct gl_context *, GLenum, GLuint,
+_mesa_shader_debug(struct gl_context *, GLenum, GLuint *id,
const char *, int)
{
}
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
extern "C" 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);
/**
* \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);
}
/*@}*/
const char *fmtString, ...) PRINTFLIKE(5, 6);
extern void
-_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint id, const char *msg, int len );
+_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
+ const char *msg, int len);
void GLAPIENTRY
_mesa_DebugMessageInsertARB(GLenum source, GLenum type, GLuint id,