Common/D3D11: Stride should be byte width

This commit is contained in:
Connor McLaughlin
2021-03-06 02:10:06 +10:00
parent bf5f53e1d1
commit 757bef7b6d
3 changed files with 13 additions and 12 deletions

View File

@ -157,13 +157,13 @@ bool D3D11HostDisplay::DownloadTexture(const void* texture_handle, HostDisplayPi
if (srv_desc.Format == DXGI_FORMAT_B5G6R5_UNORM || srv_desc.Format == DXGI_FORMAT_B5G5R5A1_UNORM)
{
return m_readback_staging_texture.ReadPixels<u16>(m_context.Get(), 0, 0, width, height,
out_data_stride / sizeof(u16), static_cast<u16*>(out_data));
return m_readback_staging_texture.ReadPixels<u16>(m_context.Get(), 0, 0, width, height, out_data_stride,
static_cast<u16*>(out_data));
}
else
{
return m_readback_staging_texture.ReadPixels<u32>(m_context.Get(), 0, 0, width, height,
out_data_stride / sizeof(u32), static_cast<u32*>(out_data));
return m_readback_staging_texture.ReadPixels<u32>(m_context.Get(), 0, 0, width, height, out_data_stride,
static_cast<u32*>(out_data));
}
}