mirror of https://gitlab.freedesktop.org/mesa/mesa
zink: track per-image swapchain layouts
this is important for handing off the swapchain between resources on makecurrent since a context that is made not-current will have its swapchain resources destroyed while the swapchain persists Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>
This commit is contained in:
parent
ba73a41a2b
commit
5db5218044
|
@ -41,6 +41,7 @@ struct kopper_swapchain_image {
|
|||
int age;
|
||||
VkImage image;
|
||||
VkSemaphore acquire;
|
||||
VkImageLayout layout;
|
||||
};
|
||||
|
||||
struct kopper_swapchain {
|
||||
|
|
|
@ -386,6 +386,12 @@ zink_resource_image_barrier(struct zink_context *ctx, struct zink_resource *res,
|
|||
res->obj->access = flags;
|
||||
res->obj->access_stage = pipeline;
|
||||
res->layout = new_layout;
|
||||
if (res->obj->dt) {
|
||||
struct kopper_displaytarget *cdt = res->obj->dt;
|
||||
if (cdt->swapchain->num_acquires && res->obj->dt_idx != UINT32_MAX) {
|
||||
cdt->swapchain->images[res->obj->dt_idx].layout = res->layout;
|
||||
}
|
||||
}
|
||||
if (new_layout != VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
|
||||
zink_resource_copies_reset(res);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue