zink: remove duplicate check and assignment in zink_resource_image_needs_barrier

zink_resource_image_barrier already checks and sets the
pipeline and the flags.

v2: make zink_resource_image_needs_barrier private (zmike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27327>
This commit is contained in:
Gert Wollny
2024-01-25 16:04:05 +01:00
parent de354a48b9
commit 2cac3adf31
2 changed files with 1 additions and 7 deletions

View File

@@ -118,8 +118,6 @@ void
zink_resource_buffer_barrier(struct zink_context *ctx, struct zink_resource *res, VkAccessFlags flags, VkPipelineStageFlags pipeline);
void
zink_resource_buffer_barrier2(struct zink_context *ctx, struct zink_resource *res, VkAccessFlags flags, VkPipelineStageFlags pipeline);
bool
zink_resource_image_needs_barrier(struct zink_resource *res, VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline);
void
zink_resource_image_barrier_init(VkImageMemoryBarrier *imb, struct zink_resource *res, VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline);
void

View File

@@ -159,13 +159,9 @@ zink_resource_access_is_write(VkAccessFlags flags)
return (flags & ~ALL_READ_ACCESS_FLAGS) > 0;
}
bool
static bool
zink_resource_image_needs_barrier(struct zink_resource *res, VkImageLayout new_layout, VkAccessFlags flags, VkPipelineStageFlags pipeline)
{
if (!pipeline)
pipeline = pipeline_dst_stage(new_layout);
if (!flags)
flags = access_dst_flags(new_layout);
return res->layout != new_layout || (res->obj->access_stage & pipeline) != pipeline ||
(res->obj->access & flags) != flags ||
zink_resource_access_is_write(res->obj->access) ||