From 81306cdc1102d423b501e38a61a98cbdd30c6a61 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 28 Nov 2018 11:06:11 +0100 Subject: [PATCH] [dxvk] Support new Vulkan presenter in DxvkDevice --- src/dxvk/dxvk_device.cpp | 15 +++++++++++++++ src/dxvk/dxvk_device.h | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index 152cac1b..d6bee81f 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -254,6 +254,21 @@ namespace dxvk { } + VkResult DxvkDevice::presentImage( + const Rc& presenter, + VkSemaphore semaphore) { + std::lock_guard queueLock(m_submissionLock); + VkResult status = presenter->presentImage(semaphore); + + if (status != VK_SUCCESS) + return status; + + std::lock_guard statLock(m_statLock); + m_statCounters.addCtr(DxvkStatCounter::QueuePresentCount, 1); + return status; + } + + void DxvkDevice::submitCommandList( const Rc& commandList, VkSemaphore waitSync, diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index 8455f11f..d860cf39 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -24,6 +24,8 @@ #include "dxvk_sync.h" #include "dxvk_unbound.h" +#include "../vulkan/vulkan_presenter.h" + namespace dxvk { class DxvkInstance; @@ -338,6 +340,18 @@ namespace dxvk { VkResult presentSwapImage( const VkPresentInfoKHR& presentInfo); + /** + * \brief Presents a swap chain image + * + * Locks the device queues and invokes the + * presenter's \c presentImage method. + * \param [in] presenter The presenter + * \param [in] semaphore Sync semaphore + */ + VkResult presentImage( + const Rc& presenter, + VkSemaphore semaphore); + /** * \brief Submits a command list *