venus: avoid redundant layout transition for optimal internal layout

This ensures no extra barriers when internal layout is wsi layout.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27020>
This commit is contained in:
Yiwei Zhang
2024-01-11 14:55:15 -08:00
committed by Marge Bot
parent 5b7c733902
commit 12d428bc68

View File

@@ -76,25 +76,33 @@
} \
} while (false)
static void
static inline void
vn_render_pass_count_present_src(const VkRenderPassCreateInfo *create_info,
uint32_t *initial_count,
uint32_t *final_count)
{
if (VN_PRESENT_SRC_INTERNAL_LAYOUT == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) {
*initial_count = *final_count = 0;
return;
}
COUNT_PRESENT_SRC(create_info->pAttachments, create_info->attachmentCount,
initial_count, final_count);
}
static void
static inline void
vn_render_pass_count_present_src2(const VkRenderPassCreateInfo2 *create_info,
uint32_t *initial_count,
uint32_t *final_count)
{
if (VN_PRESENT_SRC_INTERNAL_LAYOUT == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) {
*initial_count = *final_count = 0;
return;
}
COUNT_PRESENT_SRC(create_info->pAttachments, create_info->attachmentCount,
initial_count, final_count);
}
static void
static inline void
vn_render_pass_replace_present_src(struct vn_render_pass *pass,
const VkRenderPassCreateInfo *create_info,
VkAttachmentDescription *out_atts)
@@ -103,7 +111,7 @@ vn_render_pass_replace_present_src(struct vn_render_pass *pass,
create_info->attachmentCount, out_atts);
}
static void
static inline void
vn_render_pass_replace_present_src2(struct vn_render_pass *pass,
const VkRenderPassCreateInfo2 *create_info,
VkAttachmentDescription2 *out_atts)