mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 07:54:15 +01:00
[dxgi] Pass display refresh in windowed mode if latency sleep is enabled
This commit is contained in:
parent
21f69eceaa
commit
50375ee1ee
@ -43,6 +43,14 @@ namespace dxvk {
|
||||
|
||||
// Ensure that RGBA16 swap chains are scRGB if supported
|
||||
UpdateColorSpace(m_desc.Format, m_colorSpace);
|
||||
|
||||
// Somewhat hacky way to determine whether to forward the
|
||||
// display refresh rate in windowed mode even with a sync
|
||||
// interval of 1.
|
||||
if (!m_is_d3d12) {
|
||||
auto instance = pFactory->GetDXVKInstance();
|
||||
m_hasLatencyControl = instance->options().latencySleep == Tristate::True;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1000,10 +1008,12 @@ namespace dxvk {
|
||||
// Engage the frame limiter with large sync intervals even in windowed
|
||||
// mode since we want to avoid double-presenting to the swap chain.
|
||||
if (SyncInterval != m_frameRateSyncInterval && m_descFs.Windowed) {
|
||||
bool engageLimiter = (SyncInterval > 1u) || (SyncInterval && m_hasLatencyControl);
|
||||
|
||||
m_frameRateSyncInterval = SyncInterval;
|
||||
m_frameRateRefresh = 0.0f;
|
||||
|
||||
if (SyncInterval > 1 && wsi::isWindow(m_window)) {
|
||||
if (engageLimiter && wsi::isWindow(m_window)) {
|
||||
wsi::WsiMode mode = { };
|
||||
|
||||
if (wsi::getCurrentDisplayMode(wsi::getWindowMonitor(m_window), &mode)) {
|
||||
|
@ -205,6 +205,7 @@ namespace dxvk {
|
||||
DXGI_COLOR_SPACE_TYPE m_colorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
|
||||
|
||||
uint32_t m_globalHDRStateSerial = 0;
|
||||
bool m_hasLatencyControl = false;
|
||||
|
||||
HRESULT EnterFullscreenMode(
|
||||
IDXGIOutput1 *pTarget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user