From f51734d68ca7732575e8f35cecea60d0712796b6 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Sun, 6 May 2018 11:05:09 -0500 Subject: [PATCH] d3d: only lock a small region in case the driver tries to readback. --- win32/CDirect3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win32/CDirect3D.cpp b/win32/CDirect3D.cpp index da9ed590..eb75fa76 100644 --- a/win32/CDirect3D.cpp +++ b/win32/CDirect3D.cpp @@ -734,10 +734,11 @@ void CDirect3D::Render(SSurface Src) if (GUI.ReduceInputLag) { IDirect3DSurface9 *surface; + RECT r = { 0, 0, 2, 2 }; if (pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &surface) == D3D_OK) { - if (surface->LockRect(&lr, NULL, D3DLOCK_READONLY) == D3D_OK) + if (surface->LockRect(&lr, &r, D3DLOCK_READONLY) == D3D_OK) { surface->UnlockRect(); }