mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[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:
parent
eae559b4c9
commit
947325e00d
@ -199,8 +199,16 @@ static bool d3d11_copyFrame(Texture * tex, ID3D11Texture2D * src)
|
|||||||
tex->copyTime = microtime();
|
tex->copyTime = microtime();
|
||||||
|
|
||||||
if (tex->texDamageCount < 0)
|
if (tex->texDamageCount < 0)
|
||||||
|
{
|
||||||
|
if (!teximpl->gpu)
|
||||||
ID3D11DeviceContext_CopyResource(dxgi->deviceContext,
|
ID3D11DeviceContext_CopyResource(dxgi->deviceContext,
|
||||||
(ID3D11Resource *)dst, (ID3D11Resource *)src);
|
(ID3D11Resource *)dst, (ID3D11Resource *)src);
|
||||||
|
else
|
||||||
|
ID3D11DeviceContext_ResolveSubresource(dxgi->deviceContext,
|
||||||
|
(ID3D11Resource *)dst, 0,
|
||||||
|
(ID3D11Resource *)src, 0,
|
||||||
|
dxgi->dxgiFormat);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < tex->texDamageCount; ++i)
|
for (int i = 0; i < tex->texDamageCount; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user