mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
We currently create statically sized descriptor pools, shared among different descriptor types. Once we're unable to allocate a descriptor set from a pool, we create a new pool. The unfortunate but predictable consequence is that when we run out of descriptors of one type, we waste any unallocated descriptors of the other types. Dynamically adjusting the pool sizes could mitigate the issue, but it seems non-trivial to handle all the edge cases, particularly in situations where the descriptor count ratios change significantly between frames. Instead, by storing only a single vkd3d descriptor type in each Vulkan descriptor set we're able to create separate descriptor pools for each vkd3d descriptor type, which also avoids the issue. The main drawback of using separate descriptor sets for each descriptor type is that we can no longer pack all bounded descriptor ranges into a single descriptor set, potentially leaving fewer descriptor sets available for unbounded ranges. That seems worth it, but we may end up having to switch to a more complicated strategy if this ends up being a problem on Vulkan implementations with a very limited number of available descriptor sets.