From 000135abe158be3fbd09b67696444f670c77ece1 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 29 Jan 2024 14:41:50 -0800 Subject: [PATCH] venus: force async pipeline create on threads creating descriptor pools This works around some Unity engine behaivor with ANGLE-on-Venus, when cmd pools are created on main thread once while the render thread only does descriptor pool creation for set allocations during recording time. This change also explicitly forces async pipeline create for threads creating the device instead of implicitly via feedback cmd pool create. This ensures intended behavior when feedback is disabled. Fixes: d17ddcc8477 ("venus: dispatch background shader tasks to secondary ring") Signed-off-by: Yiwei Zhang Part-of: (cherry picked from commit 1718980e851c1cfaba80098bcd10915a7522e882) --- .pick_status.json | 2 +- src/virtio/vulkan/vn_descriptor_set.c | 2 ++ src/virtio/vulkan/vn_device.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 3aca16183ac..42e1020dee1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -11884,7 +11884,7 @@ "description": "venus: force async pipeline create on threads creating descriptor pools", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d17ddcc84773899ef8b022d94969ffc0909db0bc", "notes": null diff --git a/src/virtio/vulkan/vn_descriptor_set.c b/src/virtio/vulkan/vn_descriptor_set.c index a1899c3b409..f079262421b 100644 --- a/src/virtio/vulkan/vn_descriptor_set.c +++ b/src/virtio/vulkan/vn_descriptor_set.c @@ -390,6 +390,8 @@ vn_CreateDescriptorPool(VkDevice device, vn_async_vkCreateDescriptorPool(dev->primary_ring, device, pCreateInfo, NULL, &pool_handle); + vn_tls_set_async_pipeline_create(); + *pDescriptorPool = pool_handle; return VK_SUCCESS; diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index 00ff23ebced..61e49de673e 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -570,6 +570,8 @@ vn_CreateDevice(VkPhysicalDevice physicalDevice, vn_log(instance, "%s", physical_dev->properties.vulkan_1_2.driverInfo); } + vn_tls_set_async_pipeline_create(); + *pDevice = vn_device_to_handle(dev); return VK_SUCCESS;