mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[d3d11] Add frame rate limiter and dxgi.maxFrameRate option
This commit is contained in:
parent
4f5f85925b
commit
8b67ef724e
5 changed files with 10 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
|||
#
|
||||
# Supported values : Any non-negative integer
|
||||
|
||||
# dxgi.maxFrameRate = 0
|
||||
# d3d9.maxFrameRate = 0
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace dxvk {
|
|||
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);
|
||||
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);
|
||||
this->tearFree = config.getOption<Tristate>("dxgi.tearFree", Tristate::Auto);
|
||||
|
||||
|
|
|
@ -83,6 +83,9 @@ namespace dxvk {
|
|||
/// a higher value. May help with frame timing issues.
|
||||
int32_t maxFrameLatency;
|
||||
|
||||
/// Limit frame rate
|
||||
int32_t maxFrameRate;
|
||||
|
||||
/// Defer surface creation until first present call. This
|
||||
/// fixes issues with games that create multiple swap chains
|
||||
/// for a single window that may interfere with each other.
|
||||
|
|
|
@ -380,6 +380,9 @@ namespace dxvk {
|
|||
presenterDevice,
|
||||
presenterDesc);
|
||||
|
||||
m_presenter->setFrameRateLimit(m_parent->GetOptions()->maxFrameRate);
|
||||
m_presenter->setFrameRateLimiterRefreshRate(m_displayRefreshRate);
|
||||
|
||||
CreateRenderTargetViews();
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,8 @@ namespace dxvk {
|
|||
bool m_dirty = true;
|
||||
bool m_vsync = true;
|
||||
|
||||
double m_displayRefreshRate = 0.0;
|
||||
|
||||
HRESULT PresentImage(UINT SyncInterval);
|
||||
|
||||
void SubmitPresent(
|
||||
|
|
Loading…
Add table
Reference in a new issue