From d677c00f6dd32aaa9d980e309d15b1763b65c7ef Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 27 Feb 2023 12:56:36 -0500 Subject: [PATCH] zink: be more descriptive with perfetto buffer barriers this should print some nice info in the graphs now Part-of: --- src/gallium/drivers/zink/zink_context.c | 28 +++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 6511655ae5d..81533a464db 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3886,7 +3886,19 @@ zink_resource_buffer_barrier(struct zink_context *ctx, struct zink_resource *res assert(res->obj->access_stage); VkCommandBuffer cmdbuf = is_write ? zink_get_cmdbuf(ctx, NULL, res) : zink_get_cmdbuf(ctx, res, NULL); - bool marker = zink_cmd_debug_marker_begin(ctx, "buffer_barrier"); + bool marker = false; + if (unlikely(zink_tracing)) { + char buf[4096]; + bool first = true; + unsigned idx = 0; + u_foreach_bit64(bit, flags) { + if (!first) + buf[idx++] = '|'; + idx += snprintf(&buf[idx], sizeof(buf) - idx, "%s", vk_AccessFlagBits_to_str(1ul<obj->access_stage ? res->obj->access_stage : pipeline_access_stage(res->obj->access), @@ -3936,7 +3948,19 @@ zink_resource_buffer_barrier2(struct zink_context *ctx, struct zink_resource *re 0, NULL }; - bool marker = zink_cmd_debug_marker_begin(ctx, "buffer_barrier"); + bool marker = false; + if (unlikely(zink_tracing)) { + char buf[4096]; + bool first = true; + unsigned idx = 0; + u_foreach_bit64(bit, flags) { + if (!first) + buf[idx++] = '|'; + idx += snprintf(&buf[idx], sizeof(buf) - idx, "%s", vk_AccessFlagBits_to_str(1ul<