mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
zink: reset unordered flags for image barriers on non-matching batch access
this allows more reordering when the first barrier in a new cmdbuf can be reordered after previous ordered access exists KHR-GLES3.copy_tex_image_conversions.required.texture2d_cubemap_negz: before - ordered 68 after - ordered 16 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
This commit is contained in:
parent
e64a47cee7
commit
43be9a867e
1 changed files with 8 additions and 1 deletions
|
|
@ -335,7 +335,15 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_resource *res,
|
|||
(res->queue == zink_screen(ctx->base.screen)->gfx_queue || res->queue == VK_QUEUE_FAMILY_IGNORED))
|
||||
return;
|
||||
bool is_write = zink_resource_access_is_write(flags);
|
||||
enum zink_resource_access rw = is_write ? ZINK_RESOURCE_ACCESS_RW : ZINK_RESOURCE_ACCESS_WRITE;
|
||||
bool completed = zink_resource_usage_check_completion_fast(zink_screen(ctx->base.screen), res, rw);
|
||||
bool usage_matches = !completed && zink_resource_usage_matches(res, ctx->batch.state);
|
||||
VkCommandBuffer cmdbuf;
|
||||
if (!usage_matches) {
|
||||
res->obj->unordered_write = true;
|
||||
if (is_write || zink_resource_usage_check_completion_fast(zink_screen(ctx->base.screen), res, ZINK_RESOURCE_ACCESS_RW))
|
||||
res->obj->unordered_read = true;
|
||||
}
|
||||
/* if current batch usage exists with ordered non-transfer access, never promote
|
||||
* this avoids layout dsync
|
||||
* TODO: figure out how to link up unordered layout -> ordered layout and delete
|
||||
|
|
@ -359,7 +367,6 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_resource *res,
|
|||
}
|
||||
assert(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));
|
||||
enum zink_resource_access rw = is_write ? ZINK_RESOURCE_ACCESS_RW : ZINK_RESOURCE_ACCESS_WRITE;
|
||||
if (HAS_SYNC2) {
|
||||
VkImageMemoryBarrier2 imb;
|
||||
zink_resource_image_barrier2_init(&imb, res, new_layout, flags, pipeline);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue