vulkan/android: improve stage masks for semaphore ops

Strictly speaking, for an empty batch, there is no inherit/defined
ordering between the wait and signal operations within the batch. We
are relying on MESA impl defined behavior to transfer payloads of the
wait sempahores to the signal sempahore here.

Ideally we need a MESA internal hint to ensure transitivity, but since
this is on the legacy fallback path, it's not worth the effort. So here
we follow common wsi to use TRANSFER_BIT which avoids most unnecessary
stalls on the queue (an improvement over the previous ALL_COMMANDS_BIT).

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
This commit is contained in:
Yiwei Zhang
2025-08-25 21:23:55 +00:00
committed by Marge Bot
parent d72d0e8580
commit c4e5661f29

View File

@@ -419,13 +419,15 @@ vk_common_QueueSignalReleaseImageANDROID(VkQueue _queue,
wait_infos[i] = (VkSemaphoreSubmitInfo){
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO,
.semaphore = pWaitSemaphores[i],
.stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
/* see wsi_common_queue_present for the rationale */
.stageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT,
};
}
const VkSemaphoreSubmitInfo signal_info = {
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO,
.semaphore = queue->anb_semaphore,
.stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
/* see wsi_common_queue_present for the rationale */
.stageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT,
};
if (device->copy_sync_payloads != NULL) {
result = vk_device_copy_semaphore_payloads(