From 746529b71b97ffffa9c8ae7ae77f9e8995416ee8 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 28 Nov 2018 11:01:47 +0100 Subject: [PATCH] [dxvk] Pass raw semaphore handles to submitCommandList --- src/d3d11/d3d11_swapchain.cpp | 10 ++++++---- src/dxvk/dxvk_context.cpp | 3 ++- src/dxvk/dxvk_device.cpp | 19 +++---------------- src/dxvk/dxvk_device.h | 4 ++-- src/dxvk/dxvk_unbound.cpp | 3 ++- src/dxvk/hud/dxvk_hud_renderer.cpp | 3 ++- 6 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 6dae5c48..287d557e 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -284,8 +284,8 @@ namespace dxvk { m_device->submitCommandList( m_context->endRecording(), - wsiSemas.acquireSync, - wsiSemas.presentSync); + wsiSemas.acquireSync->handle(), + wsiSemas.presentSync->handle()); m_swapchain->present( wsiSemas.presentSync); @@ -408,7 +408,8 @@ namespace dxvk { m_device->submitCommandList( m_context->endRecording(), - nullptr, nullptr); + VK_NULL_HANDLE, + VK_NULL_HANDLE); } @@ -461,7 +462,8 @@ namespace dxvk { m_device->submitCommandList( m_context->endRecording(), - nullptr, nullptr); + VK_NULL_HANDLE, + VK_NULL_HANDLE); } diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 2ef665c2..f18c0c80 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -70,7 +70,8 @@ namespace dxvk { void DxvkContext::flushCommandList() { m_device->submitCommandList( this->endRecording(), - nullptr, nullptr); + VK_NULL_HANDLE, + VK_NULL_HANDLE); this->beginRecording( m_device->createCommandList()); diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index 9ce3ec75..152cac1b 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -256,21 +256,8 @@ namespace dxvk { void DxvkDevice::submitCommandList( const Rc& commandList, - const Rc& waitSync, - const Rc& wakeSync) { - VkSemaphore waitSemaphore = VK_NULL_HANDLE; - VkSemaphore wakeSemaphore = VK_NULL_HANDLE; - - if (waitSync != nullptr) { - waitSemaphore = waitSync->handle(); - commandList->trackResource(waitSync); - } - - if (wakeSync != nullptr) { - wakeSemaphore = wakeSync->handle(); - commandList->trackResource(wakeSync); - } - + VkSemaphore waitSync, + VkSemaphore wakeSync) { VkResult status; { // Queue submissions are not thread safe @@ -282,7 +269,7 @@ namespace dxvk { status = commandList->submit( m_graphicsQueue.queueHandle, - waitSemaphore, wakeSemaphore); + waitSync, wakeSync); } if (status == VK_SUCCESS) { diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index 3831dc35..8455f11f 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -349,8 +349,8 @@ namespace dxvk { */ void submitCommandList( const Rc& commandList, - const Rc& waitSync, - const Rc& wakeSync); + VkSemaphore waitSync, + VkSemaphore wakeSync); /** * \brief Locks submission queue diff --git a/src/dxvk/dxvk_unbound.cpp b/src/dxvk/dxvk_unbound.cpp index 67403e0a..3a306b5d 100644 --- a/src/dxvk/dxvk_unbound.cpp +++ b/src/dxvk/dxvk_unbound.cpp @@ -36,7 +36,8 @@ namespace dxvk { dev->submitCommandList( ctx->endRecording(), - nullptr, nullptr); + VK_NULL_HANDLE, + VK_NULL_HANDLE); } diff --git a/src/dxvk/hud/dxvk_hud_renderer.cpp b/src/dxvk/hud/dxvk_hud_renderer.cpp index 1df16b66..c8745b52 100644 --- a/src/dxvk/hud/dxvk_hud_renderer.cpp +++ b/src/dxvk/hud/dxvk_hud_renderer.cpp @@ -323,7 +323,8 @@ namespace dxvk::hud { device->submitCommandList( context->endRecording(), - nullptr, nullptr); + VK_NULL_HANDLE, + VK_NULL_HANDLE); }