About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiwei Zhang <zzyiwei@chromium.org>2025-08-18 15:22:21 -0700
committerMarge Bot <marge-bot@fdo.invalid>2025-08-21 14:25:22 +0000
commitf0c52fee25aef828cb01ff6fdd2d53d6062efd83 (patch)
treef68251f455901cbd30d9c63eb1dad3f5676b69c4
parent8ee7b4184189d96e61da5eb16abac9c97e7db3b2 (diff)
venus: misc sync2 emulation fixes
Venus renderer side has strict entry points sanitization based on the app requested app api version + physical device api version. So on the driver, we should follow the same for legacy client apps. Meanwhile, VK_PIPELINE_STAGE_NONE can't be used when we hit the sync2 emulation path, so we swap it with VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT placeholder for the 2nd sync scope there. Fixes: 07cee75c39c ("venus: layer vkQueueSubmit2 over vkQueueSubmit w/o sync2") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36830>
-rw-r--r--src/virtio/vulkan/vn_device.c5
-rw-r--r--src/virtio/vulkan/vn_queue.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c
index 6852cdd5c2a..a5ffe2bc4bb 100644
--- a/src/virtio/vulkan/vn_device.c
+++ b/src/virtio/vulkan/vn_device.c
@@ -504,9 +504,8 @@ vn_device_init(struct vn_device *dev,
*/
vn_device_update_shader_cache_id(dev);
- dev->has_sync2 =
- physical_dev->base.vk.properties.apiVersion >= VK_API_VERSION_1_3 ||
- dev->base.vk.enabled_extensions.KHR_synchronization2;
+ dev->has_sync2 = physical_dev->renderer_version >= VK_API_VERSION_1_3 ||
+ dev->base.vk.enabled_extensions.KHR_synchronization2;
return VK_SUCCESS;
diff --git a/src/virtio/vulkan/vn_queue.c b/src/virtio/vulkan/vn_queue.c
index 992d249eb7c..b231fbfa457 100644
--- a/src/virtio/vulkan/vn_queue.c
+++ b/src/virtio/vulkan/vn_queue.c
@@ -1135,7 +1135,9 @@ vn_queue_submit_2_to_1(struct vn_device *dev,
bool has_wait_timeline_sem = false;
for (uint32_t i = 0; i < submit->waitSemaphoreInfoCount; i++) {
_wait_sem_handles[i] = submit->pWaitSemaphoreInfos[i].semaphore;
- _wait_stages[i] = submit->pWaitSemaphoreInfos[i].stageMask;
+ _wait_stages[i] = submit->pWaitSemaphoreInfos[i].stageMask
+ ? submit->pWaitSemaphoreInfos[i].stageMask
+ : VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
VK_FROM_HANDLE(vn_semaphore, sem, _wait_sem_handles[i]);
has_wait_timeline_sem |= sem->type == VK_SEMAPHORE_TYPE_TIMELINE;