vulkan/wsi: avoid host stage when blit to foreign queue

For mitigating the below VVL violation:

> VUID-vkCmdPipelineBarrier-srcStageMask-09634
>
> vkCmdPipelineBarrier(): dstStageMask is VK_PIPELINE_STAGE_HOST_BIT
> but srcQueueFamilyIndex (0) != dstQueueFamilyIndex (4294967293).
>
> The Vulkan spec states: If either srcStageMask or dstStageMask
> includes VK_PIPELINE_STAGE_HOST_BIT, for any element of
> pBufferMemoryBarriers, srcQueueFamilyIndex and dstQueueFamilyIndex
> must be equal

Fixes: 153857fb64 ("vulkan/wsi: amend barriers for blit dst buffer going to foreign queue")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
(cherry picked from commit be9caf8ed6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
Yiwei Zhang 2026-01-14 20:49:51 -08:00 committed by Dylan Baker
parent 50cd471dbe
commit 11651c18df
2 changed files with 4 additions and 2 deletions

View file

@ -734,7 +734,7 @@
"description": "vulkan/wsi: avoid host stage when blit to foreign queue",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "153857fb64b7d2521a8b402854afed97bf247b39",
"notes": null

View file

@ -2170,7 +2170,9 @@ wsi_cmd_blit_image_to_buffer(VkCommandBuffer cmd_buffer,
};
wsi->CmdPipelineBarrier(cmd_buffer,
VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_PIPELINE_STAGE_HOST_BIT,
image->blit.to_foreign_queue
? VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
: VK_PIPELINE_STAGE_HOST_BIT,
0,
0, NULL,
1, &buf_mem_barrier,