zink: remove debug markers for u_blitter ops

these don't actually work; it creates the marker for the op, but
then the "end" of the marker is effectively determined to be the end
of the cmdbuf

instead, detect whether a draw is from u_blitter and add a marker there

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
This commit is contained in:
Mike Blumenkrantz 2023-02-28 06:45:35 -05:00 committed by Marge Bot
parent 271ebdd735
commit e650ff4ea0
3 changed files with 29 additions and 25 deletions

View file

@ -330,12 +330,6 @@ 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, 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,
info->dst.box.width, info->dst.box.height);
struct pipe_blit_info depth_blit = *info;
depth_blit.mask = PIPE_MASK_Z;
stencil_blit = util_blitter_is_blit_supported(ctx->blitter, &depth_blit);
@ -343,7 +337,6 @@ zink_blit(struct pipe_context *pctx,
zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES);
util_blitter_blit(ctx->blitter, &depth_blit);
}
zink_cmd_debug_marker_end(ctx, marker);
}
if (!stencil_blit) {
mesa_loge("ZINK: blit unsupported %s -> %s",
@ -370,11 +363,6 @@ 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, 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,
info->dst.box.width, info->dst.box.height);
struct pipe_surface *dst_view, dst_templ;
util_blitter_default_dst_texture(&dst_templ, info->dst.resource, info->dst.level, info->dst.box.z);
dst_view = pctx->create_surface(pctx, info->dst.resource, &dst_templ);
@ -393,16 +381,8 @@ zink_blit(struct pipe_context *pctx,
info->scissor_enable ? &info->scissor : NULL);
pipe_surface_release(pctx, &dst_view);
zink_cmd_debug_marker_end(ctx, marker);
} else {
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,
info->dst.box.width, info->dst.box.height);
util_blitter_blit(ctx->blitter, info);
zink_cmd_debug_marker_end(ctx, marker);
}
ctx->blitting = false;
end:

View file

@ -171,6 +171,12 @@ void
zink_update_barriers(struct zink_context *ctx, bool is_compute,
struct pipe_resource *index, struct pipe_resource *indirect, struct pipe_resource *indirect_draw_count);
bool
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);
#ifdef __cplusplus
}
#endif
@ -252,11 +258,6 @@ zink_get_dummy_pipe_surface(struct zink_context *ctx, int samples_index);
struct zink_surface *
zink_get_dummy_surface(struct zink_context *ctx, int samples_index);
bool
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);
void
debug_describe_zink_buffer_view(char *buf, const struct zink_buffer_view *ptr);

View file

@ -814,6 +814,26 @@ zink_draw(struct pipe_context *pctx,
VKCTX(CmdBeginTransformFeedbackEXT)(batch->state->cmdbuf, 0, ctx->num_so_targets, counter_buffers, counter_buffer_offsets);
}
bool marker = false;
if (unlikely(zink_tracing && ctx->blitting)) {
VkViewport viewport = {
ctx->vp_state.viewport_states[0].translate[0] - ctx->vp_state.viewport_states[0].scale[0],
ctx->vp_state.viewport_states[0].translate[1] - ctx->vp_state.viewport_states[0].scale[1],
MAX2(ctx->vp_state.viewport_states[0].scale[0] * 2, 1),
ctx->vp_state.viewport_states[0].scale[1] * 2,
CLAMP(ctx->rast_state->base.clip_halfz ?
ctx->vp_state.viewport_states[0].translate[2] :
ctx->vp_state.viewport_states[0].translate[2] - ctx->vp_state.viewport_states[0].scale[2],
0, 1),
CLAMP(ctx->vp_state.viewport_states[0].translate[2] + ctx->vp_state.viewport_states[0].scale[2],
0, 1)
};
marker = zink_cmd_debug_marker_begin(ctx, VK_NULL_HANDLE, "u_blitter(%s->%s, %dx%d)",
util_format_short_name(ctx->sampler_views[MESA_SHADER_FRAGMENT][0]->format),
util_format_short_name(ctx->fb_state.cbufs[0]->format),
viewport.width, viewport.height);
}
bool needs_drawid = reads_drawid && zink_get_last_vertex_key(ctx)->push_drawid;
work_count += num_draws;
if (index_size > 0) {
@ -871,6 +891,9 @@ zink_draw(struct pipe_context *pctx,
}
}
if (unlikely(zink_tracing && ctx->blitting))
zink_cmd_debug_marker_end(ctx, marker);
if (have_streamout) {
for (unsigned i = 0; i < ctx->num_so_targets; i++) {
struct zink_so_target *t = zink_so_target(ctx->so_targets[i]);