mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +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
|
||||
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 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.
|
||||
VkDeviceSize maxDeviceMemory;
|
||||
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> 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
|
||||
// was defined by the user, it overrides app settings.
|
||||
uint32_t bufferCount = m_desc.BufferCount;
|
||||
|
||||
if (options->numBackBuffers > 0)
|
||||
bufferCount = options->numBackBuffers;
|
||||
|
||||
// Higher values are not allowed according to the Microsoft documentation:
|
||||
//
|
||||
// "1 through 4 - Synchronize presentation after the nth vertical blank."
|
||||
|
Loading…
Reference in New Issue
Block a user