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