mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-24 08:35:01 +00:00
Prefer D3D11VA for FSE V-Sync off
This commit is contained in:
parent
dc5414bd0d
commit
7404e5fce2
2 changed files with 20 additions and 3 deletions
|
@ -367,6 +367,15 @@ bool D3D11VARenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
hr);
|
hr);
|
||||||
// Non-fatal
|
// Non-fatal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DXVA2 may let us take over for FSE V-sync off cases. However, if we don't have DXGI_FEATURE_PRESENT_ALLOW_TEARING
|
||||||
|
// then we should not attempt to do this unless there's no other option (HDR, DXVA2 failed in pass 1, etc).
|
||||||
|
if (!m_AllowTearing && m_DecoderSelectionPass == 0 && !(params->videoFormat & VIDEO_FORMAT_MASK_10BIT) &&
|
||||||
|
(SDL_GetWindowFlags(params->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Defaulting to DXVA2 for FSE without DXGI_FEATURE_PRESENT_ALLOW_TEARING support");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
|
|
|
@ -568,9 +568,11 @@ bool DXVA2Renderer::initializeDevice(SDL_Window* window, bool enableVsync)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have a WDDM 2.0 or later display driver and we're not running in
|
// If we have a WDDM 2.0 or later display driver, prefer the D3D11VA renderer
|
||||||
// full-screen exclusive mode (or we're on a multi-GPU system in FSE),
|
// in all of the following cases:
|
||||||
// prefer the D3D11VA renderer.
|
// - Multi-GPU systems
|
||||||
|
// - Windowed and borderless windowed modes
|
||||||
|
// - Full-screen exclusive with V-sync off
|
||||||
//
|
//
|
||||||
// D3D11VA is better in this case because it can enable tearing in non-FSE
|
// D3D11VA is better in this case because it can enable tearing in non-FSE
|
||||||
// modes when the user has V-Sync disabled. In non-FSE V-Sync cases, D3D11VA
|
// modes when the user has V-Sync disabled. In non-FSE V-Sync cases, D3D11VA
|
||||||
|
@ -601,6 +603,12 @@ bool DXVA2Renderer::initializeDevice(SDL_Window* window, bool enableVsync)
|
||||||
d3d9ex->Release();
|
d3d9ex->Release();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if (!enableVsync) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Defaulting to D3D11VA for FSE V-Sync Off mode");
|
||||||
|
d3d9ex->Release();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D3DCAPS9 deviceCaps;
|
D3DCAPS9 deviceCaps;
|
||||||
|
|
Loading…
Reference in a new issue