mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
zink: Set needs_barrier after transitioning to QUEUE_FAMILY_FOREIGN
Otherwise, we'll transition to QUEUE_FAMILY_FOREIGN and then forget that
we left it on the foreign queue and never transition back the next time
we use the resource. This was kind-of okay with Wayland compositors
because they always re-import the BO so it's always fresh and they pick
up on the queue transfer the first time. X11, on the other hand, does
not re-import BOs so they get stuck in this weird QUEUE_FAMILY_FOREIGN
limbo until something happens to randomly trigger a layout transition
check and then we find it and do the transition. We should mark them as
needing a barrier the moment we transition to QUEUE_FAMILY_FOREIGN.
Fixes: d4f8ad27f2 ("zink: handle implicit sync for dmabufs")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33952>
This commit is contained in:
parent
e538a38017
commit
396ece1ad8
1 changed files with 9 additions and 0 deletions
|
|
@ -891,6 +891,15 @@ zink_end_batch(struct zink_context *ctx)
|
|||
}
|
||||
res->queue = VK_QUEUE_FAMILY_FOREIGN_EXT;
|
||||
|
||||
/* We just transitioned to VK_QUEUE_FAMILY_FOREIGN_EXT. We'll need a
|
||||
* barrier to transition back to our queue before we can use this
|
||||
* resource again. Set need_barriers if bound.
|
||||
*/
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(ctx->need_barriers); i++) {
|
||||
if (res->bind_count[i])
|
||||
_mesa_set_add(ctx->need_barriers[i], res);
|
||||
}
|
||||
|
||||
for (; res; res = zink_resource(res->base.b.next)) {
|
||||
VkSemaphore sem = zink_create_exportable_semaphore(screen);
|
||||
if (sem)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue