[PATCH vkd3d v2 1/2] vkd3d: Use Vulkan timeline semaphores for D3D12 fences.

Henri Verbeet hverbeet at gmail.com
Fri Mar 11 05:01:03 CST 2022


On Wed, 9 Mar 2022 at 07:20, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
>
> D3D12 supports signalling a fence to a lower value, while Vulkan timeline
> semaphores do not. On the GPU side this is handled by simply submitting
> the signal anyway, because working around this is impractical and it
> currently works. For CPU signals the Vulkan semaphore is replaced with a
> new one at the lower value only if no waits and/or signals are pending on
> the GPU. Otherwise, a fixme is emitted.
>
> Partly based on a vkd3d-proton patch by Hans-Kristian Arntzen (not
> including the handling of lower fence values).
>
> The old implementation is used if KHR_timeline_semaphore is not
> available.
>
> Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
> ---
>  libs/vkd3d/command.c       | 562 ++++++++++++++++++++++++++++++++++---
>  libs/vkd3d/device.c        |  14 +
>  libs/vkd3d/vkd3d_private.h |  25 ++
>  libs/vkd3d/vulkan_procs.h  |   5 +
>  tests/d3d12.c              |  11 +-
>  5 files changed, 576 insertions(+), 41 deletions(-)
>
KHR_timeline_semaphore requires raising the minimum required version
of Vulkan-Headers from version 1.1.113 to version 1.2.131. That's
fine, but requires an update of the README. Unfortunately this also
introduces new failures in test_gpu_signal_fence() and
test_fence_values() for me:

    $ VKD3D_TEST_FILTER=fence tests/d3d12
    d3d12:596: Driver name: radv, driver info: Mesa 20.1.9
(git-0a443eb1ad) (LLVM 8.0.1).
    d3d12:4089: Test failed: Got unexpected value 10.
    d3d12:4100: Test failed: Got unexpected return value 0.
    d3d12:4104: Test failed: Got unexpected return value 0x1.
    d3d12:4111: Test failed: Got unexpected return value 0.
    d3d12:4115: Test failed: Got unexpected return value 0x1.
    d3d12:4141: Test failed: Got unexpected return value 0.
    d3d12:4149: Test failed: Got unexpected return value 0x1 for 3.
    d3d12:4149: Test failed: Got unexpected return value 0x1 for 5.
    d3d12:4149: Test failed: Got unexpected return value 0x1 for 9.
    d3d12:4159: Test failed: Got unexpected value 12.
    d3d12:4252: Test failed: Got unexpected return value 0.
    d3d12:4254: Test failed: Got unexpected return value 0.
    d3d12:4258: Test failed: Got unexpected return value 0x1.
    d3d12:4260: Test failed: Got unexpected return value 0x1.
    d3d12:4469: Test failed: Got value 0x2000000000000000, expected 0.
    d3d12: 1642 tests executed (15 failures, 0 skipped, 0 todo, 0 bugs).



More information about the wine-devel mailing list