From 7887d56d0c76f52c7afb8a84225d138ac9922f33 Mon Sep 17 00:00:00 2001 From: Conor McCarthy <cmccarthy@codeweavers.com> Date: Sun, 30 Jul 2023 13:34:09 +1000 Subject: [PATCH 2/2] vkd3d: Write Vulkan descriptors in a worker thread. Raises framerate in Horizon Zero Dawn by about 5-10%.
It's great that it does, but this doesn't help much with understanding which underlying issue we're addressing, or with determining whether this MR is the most appropriate way to do that.
I'll leave to Henri to decide what's best here, but I still think that having one thread per device should be easily doable and avoid wasting resources if an application, for some reason, creates a lot of heaps. Apparently neither us nor native implementations really enforce which heap descriptors come from, so it could still be that some application creates many heaps each with just a few descriptors.
Yeah, in general I'd prefer creating fewer threads rather than more, unless it either can't be avoided or there a clear advantage to creating more threads. In fact, I wonder how hard it would be to use vkd3d_fence_worker_main() for this. Waiting for fences is a blocking operation, but it may not have to be, and in principle these waits are expected to complete quickly. That also depends on which issue we're trying to address here, of course...