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 *