From: Mike Blumenkrantz Date: Tue, 30 Aug 2022 15:20:04 +0000 (-0400) Subject: zink: add screen interfaces for pipeline barriers X-Git-Tag: upstream/22.3.5~2881 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c4aaa154a0ff04be26829c822a8a30f1dd911b9;p=platform%2Fupstream%2Fmesa.git zink: add screen interfaces for pipeline barriers this will enable direct calling of the right function without the overhead of having conditionals in the barrier functions themselves eventually, the '2' variants will be widely enough deployed that this can be deleted Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 014d716..f7a84f2 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -2440,6 +2440,14 @@ zink_internal_create_screen(const struct pipe_screen_config *config) screen->base.vertex_state_destroy = zink_cache_vertex_state_destroy; glsl_type_singleton_init_or_ref(); + if (screen->info.have_vulkan13 || screen->info.have_KHR_synchronization2) { + screen->image_barrier = zink_resource_image_barrier2; + screen->buffer_barrier = zink_resource_buffer_barrier2; + } else { + screen->image_barrier = zink_resource_image_barrier; + screen->buffer_barrier = zink_resource_buffer_barrier; + } + 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"); diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 56022b6..aa0bea6 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -1107,6 +1107,9 @@ struct zink_screen { struct vk_dispatch_table vk; + void (*buffer_barrier)(struct zink_context *ctx, struct zink_resource *res, VkAccessFlags flags, VkPipelineStageFlags pipeline); + void (*image_barrier)(struct zink_context *ctx, struct zink_resource *res, VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline); + bool compact_descriptors; uint8_t desc_set_id[ZINK_MAX_DESCRIPTOR_SETS];