[host] [Patch 1/2] fix copy of padded resolutions

This commit is contained in:
Geoffrey McRae 2019-01-02 10:28:43 +11:00
parent 667aed635d
commit 2a86339b1d

View File

@ -735,19 +735,10 @@ GrabStatus Capture::DXGI::GrabFrameRaw(FrameInfo & frame)
return GRAB_STATUS_ERROR;
}
frame.pitch = m_width * 4;
frame.stride = m_width;
frame.pitch = mapping.RowPitch;
frame.stride = mapping.RowPitch / 4;
if (frame.pitch == mapping.RowPitch)
memcpySSE(frame.buffer, mapping.pData, frame.pitch * m_height);
else
for(unsigned int y = 0; y < m_height; ++y)
memcpySSE(
(uint8_t *)frame.buffer + (frame.pitch * y),
(uint8_t *)mapping.pData + (mapping.RowPitch * y),
frame.pitch
);
m_deviceContext->Unmap(m_texture[0], 0);
return GRAB_STATUS_OK;