zink: use a perf_debug() macro for debug message logging of copy box warning

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22196>
This commit is contained in:
Mike Blumenkrantz
2023-04-19 09:10:32 -04:00
committed by Marge Bot
parent 3d467c466a
commit 3909471288
4 changed files with 10 additions and 5 deletions
+5
View File
@@ -50,6 +50,11 @@ struct zink_rasterizer_state;
struct zink_resource;
struct zink_vertex_elements_state;
#define perf_debug(ctx, ...) do { \
mesa_logw(__VA_ARGS__); \
util_debug_message(&ctx->dbg, PERF_INFO, __VA_ARGS__); \
} while(0)
static inline struct zink_resource *
zink_descriptor_surface_resource(struct zink_descriptor_surface *ds)
{
+2 -2
View File
@@ -2251,7 +2251,7 @@ zink_resource_copy_box_intersects(struct zink_resource *res, unsigned level, con
/* track a new region for TRANSFER_DST barrier emission */
void
zink_resource_copy_box_add(struct zink_resource *res, unsigned level, const struct pipe_box *box)
zink_resource_copy_box_add(struct zink_context *ctx, struct zink_resource *res, unsigned level, const struct pipe_box *box)
{
if (res->obj->copies_valid) {
struct pipe_box *b = res->obj->copies[level].data;
@@ -2408,7 +2408,7 @@ zink_resource_copy_box_add(struct zink_resource *res, unsigned level, const stru
}
util_dynarray_append(&res->obj->copies[level], struct pipe_box, *box);
if (!res->copies_warned && util_dynarray_num_elements(&res->obj->copies[level], struct pipe_box) > 100) {
mesa_logw("zink: PERF WARNING! > 100 copy boxes detected for %p\n", res);
perf_debug(ctx, "zink: PERF WARNING! > 100 copy boxes detected for %p\n", res);
res->copies_warned = true;
}
res->obj->copies_valid = true;
+1 -1
View File
@@ -96,7 +96,7 @@ zink_is_swapchain(const struct zink_resource *res)
bool
zink_resource_copy_box_intersects(struct zink_resource *res, unsigned level, const struct pipe_box *box);
void
zink_resource_copy_box_add(struct zink_resource *res, unsigned level, const struct pipe_box *box);
zink_resource_copy_box_add(struct zink_context *ctx, struct zink_resource *res, unsigned level, const struct pipe_box *box);
void
zink_resource_copies_reset(struct zink_resource *res);
@@ -427,7 +427,7 @@ zink_resource_image_transfer_dst_barrier(struct zink_context *ctx, struct zink_r
res->obj->last_write = VK_ACCESS_TRANSFER_WRITE_BIT;
res->obj->access_stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
}
zink_resource_copy_box_add(res, level, box);
zink_resource_copy_box_add(ctx, res, level, box);
}
bool
@@ -457,7 +457,7 @@ zink_resource_buffer_transfer_dst_barrier(struct zink_context *ctx, struct zink_
res->obj->ordered_access_is_copied = true;
}
}
zink_resource_copy_box_add(res, 0, &box);
zink_resource_copy_box_add(ctx, res, 0, &box);
/* this return value implies that the caller could do an unordered op on this resource */
return unordered;
}