1
0
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:
Philip Rebohle 2018-09-09 19:12:07 +02:00
parent b7d8be25f1
commit d7b16dd90a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 12 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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;
};
}

View File

@ -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."