[host] dxgi: fix failure to copy to texture with sub resources

`CopyResource` will silently fail when trying to copy from a texture
with no subresources to one with. Instead we must use `ResolveSubresource`
This commit is contained in:
Geoffrey McRae 2022-05-02 15:50:15 +10:00
parent eae559b4c9
commit 947325e00d

View File

@ -199,8 +199,16 @@ static bool d3d11_copyFrame(Texture * tex, ID3D11Texture2D * src)
tex->copyTime = microtime();
if (tex->texDamageCount < 0)
ID3D11DeviceContext_CopyResource(dxgi->deviceContext,
(ID3D11Resource *)dst, (ID3D11Resource *)src);
{
if (!teximpl->gpu)
ID3D11DeviceContext_CopyResource(dxgi->deviceContext,
(ID3D11Resource *)dst, (ID3D11Resource *)src);
else
ID3D11DeviceContext_ResolveSubresource(dxgi->deviceContext,
(ID3D11Resource *)dst, 0,
(ID3D11Resource *)src, 0,
dxgi->dxgiFormat);
}
else
{
for (int i = 0; i < tex->texDamageCount; ++i)