From 1718980e851c1cfaba80098bcd10915a7522e882 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: --- src/virtio/vulkan/vn_descriptor_set.c | 2 ++ src/virtio/vulkan/vn_device.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/virtio/vulkan/vn_descriptor_set.c b/src/virtio/vulkan/vn_descriptor_set.c index 47a803c6dd2..43ea6c2af3a 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 aab76ad484a..e263d6d2b82 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;