Conor McCarthy : vkd3d: Back descriptor heaps with Vulkan descriptor sets if descriptor indexing is available.

Alexandre Julliard julliard at winehq.org
Fri Mar 18 16:38:45 CDT 2022


Module: vkd3d
Branch: master
Commit: 2b71ea406f494e9068c110a99b4ff655b667fc1e
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=2b71ea406f494e9068c110a99b4ff655b667fc1e

Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date:   Tue Feb 22 01:18:59 2022 +1000

vkd3d: Back descriptor heaps with Vulkan descriptor sets if descriptor indexing is available.

The existing implementation using virtual descriptor heaps, where Vk
descriptor sets are created for the bindings in the root descriptor tables,
is inefficient when multiple command lists are used with large descriptor
heaps. It also cannot support updating a descriptor set after it is bound.

This patch creates Vk sets for each D3D12 heap. Because D3D12 heaps
can contain CBV, SRV and UAV descriptors in the same heap, multiple Vk sets
are needed for each heap, however the total number of populated descriptors
is never more than (heap size + UAV counter count).

A new 'virtual_heaps' config option is introduced to make the old
implementation available when needed. It's not always possible to determine
if this is necessary when the device is created.

Up to nine Vk descriptor sets may be used. It's theoretically possible to
reduce this to eight by placing immutable samplers in the push descriptor
set layout, but contradictions in earlier versions of the Vulkan spec made
driver support inconsistent. The documentation was corrected in version
1.2.203.

This patch also adds support for UAV counter descriptor arrays. It's not
practical to add this in a separate patch due to complications with
combining the old UAV counter implementation with the new descriptor heap
implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47713
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47154
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 README                         |   3 +
 include/private/vkd3d_common.h |   4 +
 include/vkd3d_windows.h        |   1 +
 libs/vkd3d/command.c           | 151 +++++++++++++++++++++++++++-
 libs/vkd3d/device.c            | 159 ++++++++++++++++++++++++++++-
 libs/vkd3d/resource.c          | 197 ++++++++++++++++++++++++++++++++++++
 libs/vkd3d/state.c             | 222 +++++++++++++++++++++++++++++++++++++++--
 libs/vkd3d/vkd3d_private.h     |  56 +++++++++++
 tests/d3d12.c                  |  13 ++-
 9 files changed, 787 insertions(+), 19 deletions(-)

Diff:   https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=2b71ea406f494e9068c110a99b4ff655b667fc1e



More information about the wine-cvs mailing list