[host] dxgi: fixed frame update regression

This commit is contained in:
Geoffrey McRae 2017-12-29 07:15:59 +11:00
parent 2d746cbfd4
commit 3d9230ac93

View File

@ -416,10 +416,6 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
return GRAB_STATUS_ERROR;
}
TRACE_START("DXGI Memory Copy");
// wake up the copy threads
m_memcpy.Wake();
ID3D11Texture2DPtr src(res);
res.Release();
if (!src)
@ -431,6 +427,12 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
m_deviceContext->CopyResource(m_texture, src);
src.Release();
if (m_surfaceMapped)
{
m_deviceContext->Unmap(m_texture, 0);
m_surfaceMapped = false;
}
status = m_deviceContext->Map(m_texture, 0, D3D11_MAP_READ, 0, &m_mapping);
if (FAILED(status))
{
@ -440,6 +442,10 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
}
m_surfaceMapped = true;
TRACE_START("DXGI Memory Copy");
// wake up the copy threads
m_memcpy.Wake();
frame.width = m_width;
frame.height = m_height;
frame.pitch = m_mapping.RowPitch;