mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxgi] Add option to force-enable MAILBOX present mode
Provides Enhanced Sync-like functionality (#678).
This commit is contained in:
parent
6fb09cb9fc
commit
894d9606d5
@ -41,6 +41,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
||||||
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
|
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
|
||||||
|
this->syncMode = DxgiSyncMode(config.getOption<int32_t>("dxgi.syncMode", 0));
|
||||||
|
|
||||||
this->d3d10Enable = config.getOption<bool>("d3d10.enable", true);
|
this->d3d10Enable = config.getOption<bool>("d3d10.enable", true);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,14 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Sync mode
|
||||||
|
*/
|
||||||
|
enum class DxgiSyncMode : int32_t {
|
||||||
|
Default = 0,
|
||||||
|
Mailbox = 1,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief DXGI options
|
* \brief DXGI options
|
||||||
*
|
*
|
||||||
@ -46,6 +54,9 @@ namespace dxvk {
|
|||||||
/// passed to IDXGISwapChain::Present.
|
/// passed to IDXGISwapChain::Present.
|
||||||
int32_t syncInterval;
|
int32_t syncInterval;
|
||||||
|
|
||||||
|
/// Vsync mode
|
||||||
|
DxgiSyncMode syncMode;
|
||||||
|
|
||||||
/// Enables D3D10 support
|
/// Enables D3D10 support
|
||||||
bool d3d10Enable;
|
bool d3d10Enable;
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,8 @@ namespace dxvk {
|
|||||||
HWND window)
|
HWND window)
|
||||||
: m_window (window),
|
: m_window (window),
|
||||||
m_device (device),
|
m_device (device),
|
||||||
m_context (device->createContext()) {
|
m_context (device->createContext()),
|
||||||
|
m_syncMode(pOptions->syncMode) {
|
||||||
|
|
||||||
// Some games don't work with deferred surface creation,
|
// Some games don't work with deferred surface creation,
|
||||||
// so we should default to initializing it immediately.
|
// so we should default to initializing it immediately.
|
||||||
@ -367,6 +368,8 @@ namespace dxvk {
|
|||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
|
|
||||||
if (Vsync) {
|
if (Vsync) {
|
||||||
|
if (m_syncMode == DxgiSyncMode::Mailbox)
|
||||||
|
modes[n++] = VK_PRESENT_MODE_MAILBOX_KHR;
|
||||||
modes[n++] = VK_PRESENT_MODE_FIFO_KHR;
|
modes[n++] = VK_PRESENT_MODE_FIFO_KHR;
|
||||||
} else {
|
} else {
|
||||||
modes[n++] = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
modes[n++] = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
||||||
|
@ -163,6 +163,7 @@ namespace dxvk {
|
|||||||
DxvkLogicOpState m_loState;
|
DxvkLogicOpState m_loState;
|
||||||
DxvkBlendMode m_blendMode;
|
DxvkBlendMode m_blendMode;
|
||||||
DxvkSwapchainProperties m_options;
|
DxvkSwapchainProperties m_options;
|
||||||
|
DxgiSyncMode m_syncMode;
|
||||||
|
|
||||||
VkSurfaceFormatKHR PickSurfaceFormat(DXGI_FORMAT Fmt) const;
|
VkSurfaceFormatKHR PickSurfaceFormat(DXGI_FORMAT Fmt) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user