mesa: wire up EmitStringMarker for KHR_debug
authorRob Clark <robclark@freedesktop.org>
Sat, 5 Dec 2015 16:32:25 +0000 (11:32 -0500)
committerRob Clark <robclark@freedesktop.org>
Thu, 21 Jan 2016 22:19:05 +0000 (17:19 -0500)
The extension spec[1] describes DEBUG_TYPE_MARKER as "Annotation of the
command stream".  So for DEBUG_TYPE_MARKER, also pass the buf to the
driver's EmitStringMarker() to be inserted in the command stream.

[1] https://www.opengl.org/registry/specs/KHR/debug.txt

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/errors.c

index 630d3525fd44da24ff322815b2184476c6849db0..674364c7b0c4d5f55296f33b60e1ecea08f78222 100644 (file)
@@ -1018,6 +1018,13 @@ _mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
            gl_enum_to_debug_type(type), id,
            gl_enum_to_debug_severity(severity),
            length, buf);
+
+   if (type == GL_DEBUG_TYPE_MARKER && ctx->Driver.EmitStringMarker) {
+      /* if length not specified, string will be null terminated: */
+      if (length < 0)
+         length = strlen(buf);
+      ctx->Driver.EmitStringMarker(ctx, buf, length);
+   }
 }