Direct2D QPA: Never queue more than one frame

Microsoft recommends setting the maximum frame latency to 1:

http://blogs.windows.com/windows/b/appbuilder/archive/2013/12/18/optimizing-directx-apps-for-low-latency-input-and-longer-battery-life.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/hh780339(v=vs.85).aspx

Apparently it slightly reduces power consumption and it also slightly
increases performance. So let's set it.

Change-Id: I8a540f1e54e83d6dc13f25564e10b751e202ce66
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Louai Al-Khanji 2014-05-08 10:23:19 +03:00 committed by The Qt Project
parent 793b7e8008
commit 17dda3917d

View File

@ -90,7 +90,7 @@ public:
return false;
}
ComPtr<IDXGIDevice> dxgiDevice;
ComPtr<IDXGIDevice1> dxgiDevice;
ComPtr<IDXGIAdapter> dxgiAdapter;
hr = d3dDevice.As(&dxgiDevice);
@ -99,6 +99,9 @@ public:
return false;
}
// Ensure that DXGI doesn't queue more than one frame at a time.
dxgiDevice->SetMaximumFrameLatency(1);
hr = dxgiDevice->GetAdapter(&dxgiAdapter);
if (FAILED(hr)) {
qWarning("%s: Failed to probe DXGI Device for parent DXGI Adapter: %#x", __FUNCTION__, hr);