vkd3d: Write Vulkan descriptors in a worker thread.

Raises framerate by 5-10% in games which write thousands of descriptors
per frame, e.g. Horizon Zero Dawn.

The worker thread is a generic device worker which can also be used for
other purposes if the need arises.
This commit is contained in:
Conor McCarthy
2023-07-30 13:34:09 +10:00
committed by Alexandre Julliard
parent 70962ae7d8
commit 37e76618ca
Notes: Alexandre Julliard 2023-12-14 23:31:17 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/292
4 changed files with 133 additions and 0 deletions

View File

@@ -2644,6 +2644,8 @@ static bool d3d12_command_list_update_compute_pipeline(struct d3d12_command_list
{
const struct vkd3d_vk_device_procs *vk_procs = &list->device->vk_procs;
vkd3d_cond_signal(&list->device->worker_cond);
if (list->current_pipeline != VK_NULL_HANDLE)
return true;
@@ -2665,6 +2667,8 @@ static bool d3d12_command_list_update_graphics_pipeline(struct d3d12_command_lis
VkRenderPass vk_render_pass;
VkPipeline vk_pipeline;
vkd3d_cond_signal(&list->device->worker_cond);
if (list->current_pipeline != VK_NULL_HANDLE)
return true;