There was only a single user which was using strlen(buf).
As this function is not user facing (i.e. we don't need to feed back
original length via a callback), we can simplify things.
Suggested-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
struct gl_context *ctx = state->ctx;
/* Report the error via GL_ARB_debug_output. */
- _mesa_shader_debug(ctx, type, &msg_id, msg, strlen(msg));
+ _mesa_shader_debug(ctx, type, &msg_id, msg);
ralloc_strcat(&state->info_log, "\n");
}
void
_mesa_shader_debug(struct gl_context *, GLenum, GLuint *,
- const char *, int)
+ const char *)
{
}
extern "C" void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
- const char *msg, int len);
+ const char *msg);
static inline gl_shader_stage
_mesa_shader_enum_to_shader_stage(GLenum v)
* \param ctx GL context.
* \param type The namespace to which this message belongs.
* \param id The message ID within the given namespace.
- * \param msg The message to output. Need not be null-terminated.
- * \param len The length of 'msg'. If negative, 'msg' must be null-terminated.
+ * \param msg The message to output. Must be null-terminated.
*/
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)
{
enum mesa_debug_source source = MESA_DEBUG_SOURCE_SHADER_COMPILER;
enum mesa_debug_severity severity = MESA_DEBUG_SEVERITY_HIGH;
+ int len;
debug_get_id(id);
- if (len < 0)
- len = strlen(msg);
+ len = strlen(msg);
/* Truncate the message if necessary. */
if (len >= MAX_DEBUG_MESSAGE_LENGTH)
extern void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
- const char *msg, int len);
+ const char *msg);
void GLAPIENTRY
_mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,