[Mesa-dev] [PATCH v2 2/4] mesa: wire up EmitStringMarker for KHR_debug

Rob Clark robdclark at gmail.com
Wed Jan 20 11:32:05 PST 2016


From: Rob Clark <robclark at freedesktop.org>

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 at freedesktop.org>
---
 src/mesa/main/errors.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
index fc3c6d0..bb66141 100644
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -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);
+   }
 }
 
 
-- 
2.5.0



More information about the mesa-dev mailing list