From 37900ee2dd13b735a6e46ddd272f45df4c8ad8a9 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sun, 25 Sep 2022 00:37:25 +0000 Subject: [PATCH] mesa/st: emit string marker based on PIPE_CAP_STRING_MARKER Fixes: 10ac88b72fa ("mesa/st: drop emit string marker device table entry.") Signed-off-by: Yiwei Zhang Reviewed-by: Mike Blumenkrantz Part-of: --- src/mesa/main/debug_output.c | 2 +- src/mesa/main/mtypes.h | 1 + src/mesa/state_tracker/st_context.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c index fbf414ffbf1..bee71950dea 100644 --- a/src/mesa/main/debug_output.c +++ b/src/mesa/main/debug_output.c @@ -1089,7 +1089,7 @@ _mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id, gl_enum_to_debug_severity(severity), length, buf); - if (type == GL_DEBUG_TYPE_MARKER && ctx->pipe->emit_string_marker) { + if (type == GL_DEBUG_TYPE_MARKER && ctx->has_string_marker) { ctx->pipe->emit_string_marker(ctx->pipe, buf, length); } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index a7a22d754b4..aed34e98286 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3631,6 +3631,7 @@ struct gl_context struct st_config_options *st_opts; struct cso_context *cso_context; bool has_invalidate_buffer; + bool has_string_marker; /* On old libGL's for linux we need to invalidate the drawables * on glViewpport calls, this is set via a option. */ diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b80cc96187b..2da67fe44f8 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -890,6 +890,9 @@ st_create_context(gl_api api, struct pipe_context *pipe, if (pipe->screen->get_param(pipe->screen, PIPE_CAP_INVALIDATE_BUFFER)) ctx->has_invalidate_buffer = true; + if (pipe->screen->get_param(pipe->screen, PIPE_CAP_STRING_MARKER)) + ctx->has_string_marker = true; + st = st_create_context_priv(ctx, pipe, options); if (!st) { _mesa_free_context_data(ctx, true);