mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 13:54:18 +01:00
[dxgi,d3d11] Move syncInterval override to DXGI swap chain
This way it also applies to D3D12 games.
This commit is contained in:
parent
c423819e90
commit
eb339bc7e4
@ -31,7 +31,6 @@ namespace dxvk {
|
|||||||
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
||||||
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
|
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
|
||||||
this->maxFrameRate = config.getOption<int32_t>("dxgi.maxFrameRate", 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
|
// Clamp LOD bias so that people don't abuse this in unintended ways
|
||||||
this->samplerLodBias = dxvk::fclamp(this->samplerLodBias, -2.0f, 1.0f);
|
this->samplerLodBias = dxvk::fclamp(this->samplerLodBias, -2.0f, 1.0f);
|
||||||
|
@ -76,10 +76,6 @@ namespace dxvk {
|
|||||||
/// Overrides DXGI_SWAP_CHAIN_DESC::BufferCount.
|
/// Overrides DXGI_SWAP_CHAIN_DESC::BufferCount.
|
||||||
int32_t numBackBuffers;
|
int32_t numBackBuffers;
|
||||||
|
|
||||||
/// Sync interval. Overrides the value
|
|
||||||
/// passed to IDXGISwapChain::Present.
|
|
||||||
int32_t syncInterval;
|
|
||||||
|
|
||||||
/// Override maximum frame latency if the app specifies
|
/// Override maximum frame latency if the app specifies
|
||||||
/// a higher value. May help with frame timing issues.
|
/// a higher value. May help with frame timing issues.
|
||||||
int32_t maxFrameLatency;
|
int32_t maxFrameLatency;
|
||||||
|
@ -254,11 +254,6 @@ namespace dxvk {
|
|||||||
UINT SyncInterval,
|
UINT SyncInterval,
|
||||||
UINT PresentFlags,
|
UINT PresentFlags,
|
||||||
const DXGI_PRESENT_PARAMETERS* pPresentParameters) {
|
const DXGI_PRESENT_PARAMETERS* pPresentParameters) {
|
||||||
auto options = m_parent->GetOptions();
|
|
||||||
|
|
||||||
if (options->syncInterval >= 0)
|
|
||||||
SyncInterval = options->syncInterval;
|
|
||||||
|
|
||||||
if (!(PresentFlags & DXGI_PRESENT_TEST))
|
if (!(PresentFlags & DXGI_PRESENT_TEST))
|
||||||
m_dirty |= m_presenter->setSyncInterval(SyncInterval) != VK_SUCCESS;
|
m_dirty |= m_presenter->setSyncInterval(SyncInterval) != VK_SUCCESS;
|
||||||
|
|
||||||
|
@ -78,6 +78,8 @@ namespace dxvk {
|
|||||||
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->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
|
||||||
|
|
||||||
// Expose Nvidia GPUs properly if NvAPI is enabled in environment
|
// Expose Nvidia GPUs properly if NvAPI is enabled in environment
|
||||||
this->hideNvidiaGpu = !isNvapiEnabled();
|
this->hideNvidiaGpu = !isNvapiEnabled();
|
||||||
|
|
||||||
|
@ -47,6 +47,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
/// Use monitor fallback to enumerating all monitors per output
|
/// Use monitor fallback to enumerating all monitors per output
|
||||||
bool useMonitorFallback;
|
bool useMonitorFallback;
|
||||||
|
|
||||||
|
/// Sync interval. Overrides the value
|
||||||
|
/// passed to IDXGISwapChain::Present.
|
||||||
|
int32_t syncInterval;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -312,6 +312,11 @@ namespace dxvk {
|
|||||||
if (SyncInterval > 4)
|
if (SyncInterval > 4)
|
||||||
return DXGI_ERROR_INVALID_CALL;
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
|
auto options = m_factory->GetOptions();
|
||||||
|
|
||||||
|
if (options->syncInterval >= 0)
|
||||||
|
SyncInterval = options->syncInterval;
|
||||||
|
|
||||||
UpdateGlobalHDRState();
|
UpdateGlobalHDRState();
|
||||||
|
|
||||||
std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow);
|
std::lock_guard<dxvk::recursive_mutex> lockWin(m_lockWindow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user