diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 6bce401d2b9..fb402ed1367 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -1193,6 +1193,9 @@ zink_destroy_screen(struct pipe_screen *pscreen) zink_kopper_deinit_displaytarget(screen, entry->data); simple_mtx_destroy(&screen->dt_lock); + if (screen->copy_context) + screen->copy_context->base.destroy(&screen->copy_context->base); + if (VK_NULL_HANDLE != screen->debugUtilsCallbackHandle) { VKSCR(DestroyDebugUtilsMessengerEXT)(screen->instance, screen->debugUtilsCallbackHandle, NULL); } @@ -2225,6 +2228,11 @@ zink_internal_create_screen(const struct pipe_screen_config *config) glsl_type_singleton_init_or_ref(); init_driver_workarounds(screen); + screen->copy_context = zink_context(screen->base.context_create(&screen->base, NULL, ZINK_CONTEXT_COPY_ONLY)); + if (!screen->copy_context) { + mesa_loge("zink: failed to create copy context"); + goto fail; + } return screen; diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index ad4e306a700..d6e8c994b4e 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -87,6 +87,7 @@ struct zink_screen { VkSemaphore sem; VkSemaphore prev_sem; struct util_queue flush_queue; + struct zink_context *copy_context; unsigned buffer_rebind_counter;