panvk: Skip barrier QFOT if src_qfi equals dst_qfi

Do not perform a queue family ownership transfer during memory barriers
if srcQueueFamilyIndex equals dstQueueFamilyIndex, as the Vulkan spec
mandates that this should only happen if the two values are unequal.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Fixes: 715d6e740a ("panvk: improve VK_QUEUE_FAMILY_EXTERNAL support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35458>
This commit is contained in:
Lars-Ivar Hesselberg Simonsen 2025-06-11 11:13:23 +02:00 committed by Marge Bot
parent 75736aa494
commit 5d0465a253

View file

@ -445,36 +445,39 @@ normalize_dependency(VkPipelineStageFlags2 *src_stages,
VkAccessFlags2 *src_access, VkAccessFlags2 *dst_access,
uint32_t src_qfi, uint32_t dst_qfi)
{
/* queue family acquire operation */
switch (src_qfi) {
case VK_QUEUE_FAMILY_EXTERNAL:
/* no execution dependency and no availability operation */
*src_stages = VK_PIPELINE_STAGE_2_NONE;
*src_access = VK_ACCESS_2_NONE;
break;
case VK_QUEUE_FAMILY_FOREIGN_EXT:
/* treat the foreign queue as the host */
*src_stages = VK_PIPELINE_STAGE_2_HOST_BIT;
*src_access = VK_ACCESS_2_HOST_WRITE_BIT;
break;
default:
break;
}
/* Perform queue family ownership transfer if src and dst are unequal. */
if (src_qfi != dst_qfi) {
/* queue family acquire operation */
switch (src_qfi) {
case VK_QUEUE_FAMILY_EXTERNAL:
/* no execution dependency and no availability operation */
*src_stages = VK_PIPELINE_STAGE_2_NONE;
*src_access = VK_ACCESS_2_NONE;
break;
case VK_QUEUE_FAMILY_FOREIGN_EXT:
/* treat the foreign queue as the host */
*src_stages = VK_PIPELINE_STAGE_2_HOST_BIT;
*src_access = VK_ACCESS_2_HOST_WRITE_BIT;
break;
default:
break;
}
/* queue family release operation */
switch (dst_qfi) {
case VK_QUEUE_FAMILY_EXTERNAL:
/* no execution dependency and no visibility operation */
*dst_stages = VK_PIPELINE_STAGE_2_NONE;
*dst_access = VK_ACCESS_2_NONE;
break;
case VK_QUEUE_FAMILY_FOREIGN_EXT:
/* treat the foreign queue as the host */
*dst_stages = VK_PIPELINE_STAGE_2_HOST_BIT;
*dst_access = VK_ACCESS_2_HOST_WRITE_BIT;
break;
default:
break;
/* queue family release operation */
switch (dst_qfi) {
case VK_QUEUE_FAMILY_EXTERNAL:
/* no execution dependency and no visibility operation */
*dst_stages = VK_PIPELINE_STAGE_2_NONE;
*dst_access = VK_ACCESS_2_NONE;
break;
case VK_QUEUE_FAMILY_FOREIGN_EXT:
/* treat the foreign queue as the host */
*dst_stages = VK_PIPELINE_STAGE_2_HOST_BIT;
*dst_access = VK_ACCESS_2_HOST_WRITE_BIT;
break;
default:
break;
}
}
*src_stages = vk_expand_src_stage_flags2(*src_stages);