zink: pass cmdbuf to debug marker begin

this is otherwise broken with cmdbuf reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
This commit is contained in:
Mike Blumenkrantz 2023-02-28 05:56:27 -05:00 committed by Marge Bot
parent 60496f6376
commit 271ebdd735
4 changed files with 13 additions and 13 deletions

View file

@ -71,7 +71,7 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info, bool *
zink_batch_reference_resource_rw(batch, src, false);
zink_batch_reference_resource_rw(batch, dst, true);
bool marker = zink_cmd_debug_marker_begin(ctx, "blit_resolve(%s->%s, %dx%d->%dx%d)",
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "blit_resolve(%s->%s, %dx%d->%dx%d)",
util_format_short_name(info->src.format),
util_format_short_name(info->src.format),
info->src.box.width, info->src.box.height,
@ -181,7 +181,7 @@ blit_native(struct zink_context *ctx, const struct pipe_blit_info *info, bool *n
zink_batch_reference_resource_rw(batch, src, false);
zink_batch_reference_resource_rw(batch, dst, true);
bool marker = zink_cmd_debug_marker_begin(ctx, "blit_native(%s->%s, %dx%d->%dx%d)",
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "blit_native(%s->%s, %dx%d->%dx%d)",
util_format_short_name(info->src.format),
util_format_short_name(info->src.format),
info->src.box.width, info->src.box.height,
@ -330,7 +330,7 @@ zink_blit(struct pipe_context *pctx,
bool stencil_blit = false;
if (!util_blitter_is_blit_supported(ctx->blitter, info)) {
if (util_format_is_depth_or_stencil(info->src.resource->format)) {
bool marker = zink_cmd_debug_marker_begin(ctx, "zink_blit(Z %s->%s, %dx%d->%dx%d)",
bool marker = zink_cmd_debug_marker_begin(ctx, VK_NULL_HANDLE, "zink_blit(Z %s->%s, %dx%d->%dx%d)",
util_format_short_name(info->src.format),
util_format_short_name(info->dst.format),
info->src.box.width, info->src.box.height,
@ -370,7 +370,7 @@ zink_blit(struct pipe_context *pctx,
zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES);
if (stencil_blit) {
bool marker = zink_cmd_debug_marker_begin(ctx, "zink_blit(S fallback %s->%s, %dx%d->%dx%d)",
bool marker = zink_cmd_debug_marker_begin(ctx, VK_NULL_HANDLE, "zink_blit(S fallback %s->%s, %dx%d->%dx%d)",
util_format_short_name(info->src.format),
util_format_short_name(info->dst.format),
info->src.box.width, info->src.box.height,
@ -396,7 +396,7 @@ zink_blit(struct pipe_context *pctx,
zink_cmd_debug_marker_end(ctx, marker);
} else {
bool marker = zink_cmd_debug_marker_begin(ctx, "zink_blit(%s->%s, %dx%d->%dx%d)",
bool marker = zink_cmd_debug_marker_begin(ctx, VK_NULL_HANDLE, "zink_blit(%s->%s, %dx%d->%dx%d)",
util_format_short_name(info->src.format),
util_format_short_name(info->dst.format),
info->src.box.width, info->src.box.height,

View file

@ -3737,7 +3737,7 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_resource *res,
imb.dstQueueFamilyIndex = zink_screen(ctx->base.screen)->gfx_queue;
res->dmabuf_acquire = false;
}
bool marker = zink_cmd_debug_marker_begin(ctx, "image_barrier(%s->%s)", vk_ImageLayout_to_str(res->layout), vk_ImageLayout_to_str(new_layout));
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "image_barrier(%s->%s)", vk_ImageLayout_to_str(res->layout), vk_ImageLayout_to_str(new_layout));
VKCTX(CmdPipelineBarrier)(
cmdbuf,
res->obj->access_stage ? res->obj->access_stage : VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
@ -3792,7 +3792,7 @@ zink_resource_image_barrier2(struct zink_context *ctx, struct zink_resource *res
1,
&imb
};
bool marker = zink_cmd_debug_marker_begin(ctx, "image_barrier(%s->%s)", vk_ImageLayout_to_str(res->layout), vk_ImageLayout_to_str(new_layout));
bool marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "image_barrier(%s->%s)", vk_ImageLayout_to_str(res->layout), vk_ImageLayout_to_str(new_layout));
VKCTX(CmdPipelineBarrier2)(cmdbuf, &dep);
zink_cmd_debug_marker_end(ctx, marker);
@ -3897,7 +3897,7 @@ zink_resource_buffer_barrier(struct zink_context *ctx, struct zink_resource *res
idx += snprintf(&buf[idx], sizeof(buf) - idx, "%s", vk_AccessFlagBits_to_str(1ul<<bit));
first = false;
}
marker = zink_cmd_debug_marker_begin(ctx, "buffer_barrier(%s)", buf);
marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "buffer_barrier(%s)", buf);
}
VKCTX(CmdPipelineBarrier)(
cmdbuf,
@ -3959,7 +3959,7 @@ zink_resource_buffer_barrier2(struct zink_context *ctx, struct zink_resource *re
idx += snprintf(&buf[idx], sizeof(buf) - idx, "%s", vk_AccessFlagBits_to_str(1ul<<bit));
first = false;
}
marker = zink_cmd_debug_marker_begin(ctx, "buffer_barrier(%s)", buf);
marker = zink_cmd_debug_marker_begin(ctx, cmdbuf, "buffer_barrier(%s)", buf);
}
VKCTX(CmdPipelineBarrier2)(cmdbuf, &dep);
zink_cmd_debug_marker_end(ctx, marker);
@ -5503,7 +5503,7 @@ zink_update_barriers(struct zink_context *ctx, bool is_compute,
* execution on the GPU.
*/
bool
zink_cmd_debug_marker_begin(struct zink_context *ctx, const char *fmt, ...)
zink_cmd_debug_marker_begin(struct zink_context *ctx, VkCommandBuffer cmdbuf, const char *fmt, ...)
{
if (!zink_tracing)
return false;
@ -5521,7 +5521,7 @@ zink_cmd_debug_marker_begin(struct zink_context *ctx, const char *fmt, ...)
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
info.pLabelName = name;
VKCTX(CmdBeginDebugUtilsLabelEXT)(ctx->batch.state->cmdbuf, &info);
VKCTX(CmdBeginDebugUtilsLabelEXT)(cmdbuf ? cmdbuf : ctx->batch.state->cmdbuf, &info);
free(name);
return true;

View file

@ -253,7 +253,7 @@ struct zink_surface *
zink_get_dummy_surface(struct zink_context *ctx, int samples_index);
bool
zink_cmd_debug_marker_begin(struct zink_context *ctx, const char *fmt, ...);
zink_cmd_debug_marker_begin(struct zink_context *ctx, VkCommandBuffer cmdbuf, const char *fmt, ...);
void
zink_cmd_debug_marker_end(struct zink_context *ctx, bool emitted);

View file

@ -760,7 +760,7 @@ copy_pool_results_to_buffer(struct zink_context *ctx, struct zink_query *query,
if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)
result_size += type_size;
bool marker = zink_cmd_debug_marker_begin(ctx, "update_qbo(%s: id=%u, num_results=%d)", vk_QueryType_to_str(query->vkqtype), query_id, num_results);
bool marker = zink_cmd_debug_marker_begin(ctx, VK_NULL_HANDLE, "update_qbo(%s: id=%u, num_results=%d)", vk_QueryType_to_str(query->vkqtype), query_id, num_results);
zink_batch_no_rp(ctx);
/* if it's a single query that doesn't need special handling, we can copy it and be done */