[dxgi,d3d11] Move syncInterval override to DXGI swap chain

This way it also applies to D3D12 games.
This commit is contained in:
Philip Rebohle 2024-02-02 17:20:24 +01:00
parent c423819e90
commit eb339bc7e4
6 changed files with 11 additions and 10 deletions

View File

@ -31,7 +31,6 @@ namespace dxvk {
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
this->maxFrameRate = config.getOption<int32_t>("dxgi.maxFrameRate", 0);
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
// Clamp LOD bias so that people don't abuse this in unintended ways
this->samplerLodBias = dxvk::fclamp(this->samplerLodBias, -2.0f, 1.0f);

View File

@ -76,10 +76,6 @@ namespace dxvk {
/// Overrides DXGI_SWAP_CHAIN_DESC::BufferCount.
int32_t numBackBuffers;
/// Sync interval. Overrides the value
/// passed to IDXGISwapChain::Present.
int32_t syncInterval;
/// Override maximum frame latency if the app specifies
/// a higher value. May help with frame timing issues.
int32_t maxFrameLatency;

View File

@ -254,11 +254,6 @@ namespace dxvk {
UINT SyncInterval,
UINT PresentFlags,
const DXGI_PRESENT_PARAMETERS* pPresentParameters) {
auto options = m_parent->GetOptions();
if (options->syncInterval >= 0)
SyncInterval = options->syncInterval;
if (!(PresentFlags & DXGI_PRESENT_TEST))
m_dirty |= m_presenter->setSyncInterval(SyncInterval) != VK_SUCCESS;

View File

@ -78,6 +78,8 @@ namespace dxvk {
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20;
this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20;
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
// Expose Nvidia GPUs properly if NvAPI is enabled in environment
this->hideNvidiaGpu = !isNvapiEnabled();

View File

@ -47,6 +47,10 @@ namespace dxvk {
/// Use monitor fallback to enumerating all monitors per output
bool useMonitorFallback;
/// Sync interval. Overrides the value
/// passed to IDXGISwapChain::Present.
int32_t syncInterval;
};
}

View File

@ -312,6 +312,11 @@ namespace dxvk {
if (SyncInterval > 4)
return DXGI_ERROR_INVALID_CALL;
auto options = m_factory->GetOptions();
if (options->syncInterval >= 0)
SyncInterval = options->syncInterval;
UpdateGlobalHDRState();
std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow);