mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 22:54:16 +01:00
[dxgi] Add option to change the back buffer count
This commit is contained in:
parent
b7d8be25f1
commit
d7b16dd90a
@ -38,6 +38,8 @@ namespace dxvk {
|
|||||||
// Interpret the memory limits as Megabytes
|
// Interpret the memory limits as Megabytes
|
||||||
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20;
|
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20;
|
||||||
this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20;
|
this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20;
|
||||||
|
|
||||||
|
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -37,6 +37,10 @@ namespace dxvk {
|
|||||||
/// more than 4 GiB of VRAM.
|
/// more than 4 GiB of VRAM.
|
||||||
VkDeviceSize maxDeviceMemory;
|
VkDeviceSize maxDeviceMemory;
|
||||||
VkDeviceSize maxSharedMemory;
|
VkDeviceSize maxSharedMemory;
|
||||||
|
|
||||||
|
/// Back buffer count for the Vulkan swap chain.
|
||||||
|
/// Overrides DXGI_SWAP_CHAIN_DESC::BufferCount.
|
||||||
|
int32_t numBackBuffers;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -272,10 +272,16 @@ namespace dxvk {
|
|||||||
std::lock_guard<std::mutex> lockWin(m_lockWindow);
|
std::lock_guard<std::mutex> lockWin(m_lockWindow);
|
||||||
std::lock_guard<std::mutex> lockBuf(m_lockBuffer);
|
std::lock_guard<std::mutex> lockBuf(m_lockBuffer);
|
||||||
|
|
||||||
|
// We'll apply certainl user options to the presenter
|
||||||
|
const DxgiOptions* options = m_factory->GetOptions();
|
||||||
|
|
||||||
// Retrieve the number of back buffers. If this option
|
// Retrieve the number of back buffers. If this option
|
||||||
// was defined by the user, it overrides app settings.
|
// was defined by the user, it overrides app settings.
|
||||||
uint32_t bufferCount = m_desc.BufferCount;
|
uint32_t bufferCount = m_desc.BufferCount;
|
||||||
|
|
||||||
|
if (options->numBackBuffers > 0)
|
||||||
|
bufferCount = options->numBackBuffers;
|
||||||
|
|
||||||
// Higher values are not allowed according to the Microsoft documentation:
|
// Higher values are not allowed according to the Microsoft documentation:
|
||||||
//
|
//
|
||||||
// "1 through 4 - Synchronize presentation after the nth vertical blank."
|
// "1 through 4 - Synchronize presentation after the nth vertical blank."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user