1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[dxvk] Support new Vulkan presenter in DxvkDevice

This commit is contained in:
Philip Rebohle 2018-11-28 11:06:11 +01:00
parent 746529b71b
commit 81306cdc11
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 29 additions and 0 deletions

View File

@ -254,6 +254,21 @@ namespace dxvk {
}
VkResult DxvkDevice::presentImage(
const Rc<vk::Presenter>& presenter,
VkSemaphore semaphore) {
std::lock_guard<std::mutex> queueLock(m_submissionLock);
VkResult status = presenter->presentImage(semaphore);
if (status != VK_SUCCESS)
return status;
std::lock_guard<sync::Spinlock> statLock(m_statLock);
m_statCounters.addCtr(DxvkStatCounter::QueuePresentCount, 1);
return status;
}
void DxvkDevice::submitCommandList(
const Rc<DxvkCommandList>& commandList,
VkSemaphore waitSync,

View File

@ -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<vk::Presenter>& presenter,
VkSemaphore semaphore);
/**
* \brief Submits a command list
*