[host] dxgi: don't release the frame until we need a new one

Per Microsoft spec we should not release the frame until we are about to
acquire another frame, this pervents additional GPU overhead on the
guest.
This commit is contained in:
Geoffrey McRae
2017-12-18 12:03:22 +11:00
parent 49acc6ec0b
commit 8dec59f3ff
2 changed files with 46 additions and 27 deletions

View File

@@ -67,6 +67,8 @@ namespace Capture
enum GrabStatus GrabFrame(struct FrameInfo & frame);
private:
void WaitForDesktop();
CaptureOptions * m_options;
bool m_initialized;
@@ -79,6 +81,7 @@ namespace Capture
ID3D11DeviceContextPtr m_deviceContext;
IDXGIOutput1Ptr m_output;
IDXGIOutputDuplicationPtr m_dup;
bool m_releaseFrame;
ID3D11Texture2DPtr m_texture;
IDXGISurface1Ptr m_surface;
D3D11_TEXTURE2D_DESC m_desc;