bool error = (type == GL_DEBUG_TYPE_ERROR_ARB);
assert(state->info_log != NULL);
+
+ /* Get the offset that the new message will be written to. */
+ int msg_offset = strlen(state->info_log);
+
ralloc_asprintf_append(&state->info_log, "%u:%u(%u): %s: ",
locp->source,
locp->first_line,
locp->first_column,
error ? "error" : "warning");
ralloc_vasprintf_append(&state->info_log, fmt, ap);
+
+ 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));
+
ralloc_strcat(&state->info_log, "\n");
}
*ptr = sh;
}
+void
+_mesa_shader_debug(struct gl_context *, GLenum, GLuint,
+ const char *, int)
+{
+}
+
struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
extern "C" struct gl_shader *
_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,
+ const char *msg, int len);
+
/**
* Initialize the given gl_context structure to a reasonable set of
* defaults representing the minimum capabilities required by the