zink: add flag to restrict unsynchronized texture access

this is unset any time a texture is accessed and must be explicitly
re-set to preserve unsynchronized access

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
This commit is contained in:
Mike Blumenkrantz 2023-10-13 12:47:15 -04:00 committed by Marge Bot
parent 8ee0d6dd71
commit cd08b070a3
5 changed files with 5 additions and 0 deletions

View file

@ -36,6 +36,7 @@ reset_obj(struct zink_screen *screen, struct zink_batch_state *bs, struct zink_r
obj->access_stage = 0;
obj->unordered_access_stage = 0;
obj->copies_need_reset = true;
obj->unsync_access = true;
/* also prune dead view objects */
simple_mtx_lock(&obj->view_lock);
if (obj->is_buffer) {

View file

@ -4535,6 +4535,7 @@ zink_copy_image_buffer(struct zink_context *ctx, struct zink_resource *dst, stru
zink_batch_reference_resource_rw(batch, buf, !buf2img);
if (unsync) {
ctx->batch.state->has_unsync = true;
img->obj->unsync_access = true;
}
/* we're using u_transfer_helper_deinterleave, which means we'll be getting PIPE_MAP_* usage

View file

@ -779,6 +779,7 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
u_rwlock_init(&obj->copy_lock);
obj->unordered_read = true;
obj->unordered_write = true;
obj->unsync_access = true;
obj->last_dt_idx = obj->dt_idx = UINT32_MAX; //TODO: unionize
VkMemoryRequirements reqs = {0};

View file

@ -163,6 +163,7 @@ static inline void
zink_resource_usage_set(struct zink_resource *res, struct zink_batch_state *bs, bool write)
{
zink_bo_usage_set(res->obj->bo, bs, write);
res->obj->unsync_access = false;
}
static inline bool

View file

@ -1233,6 +1233,7 @@ struct zink_resource_object {
bool ordered_access_is_copied;
bool unordered_read;
bool unordered_write;
bool unsync_access;
bool copies_valid;
bool copies_need_reset; //for use with batch state resets