mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:31:46 +00:00
[c-host] dxgi: remove needsUnmap bool
This commit is contained in:
parent
925a93686b
commit
935eb0651d
1 changed files with 4 additions and 6 deletions
|
@ -43,7 +43,6 @@ struct iface
|
|||
ID3D11Texture2D * texture;
|
||||
D3D11_MAPPED_SUBRESOURCE mapping;
|
||||
bool needsRelease;
|
||||
bool needsUnmap;
|
||||
osEventHandle * copyEvent;
|
||||
osEventHandle * frameEvent;
|
||||
osEventHandle * pointerEvent;
|
||||
|
@ -366,10 +365,10 @@ static bool dxgi_deinit()
|
|||
{
|
||||
assert(this);
|
||||
|
||||
if (this->needsUnmap)
|
||||
if (this->mapping.pData)
|
||||
{
|
||||
ID3D11DeviceContext_Unmap(this->deviceContext, (ID3D11Resource*)this->texture, 0);
|
||||
this->needsUnmap = false;
|
||||
this->mapping.pData = NULL;
|
||||
}
|
||||
|
||||
if (this->texture)
|
||||
|
@ -494,10 +493,10 @@ static CaptureResult dxgi_capture(bool * hasFrameUpdate, bool * hasPointerUpdate
|
|||
|
||||
// wait for the prior copy to finish in getFrame and unmap
|
||||
os_waitEvent(this->copyEvent);
|
||||
if (this->needsUnmap)
|
||||
if (this->mapping.pData)
|
||||
{
|
||||
ID3D11DeviceContext_Unmap(this->deviceContext, (ID3D11Resource*)this->texture, 0);
|
||||
this->needsUnmap = false;
|
||||
this->mapping.pData = NULL;
|
||||
}
|
||||
|
||||
// issue the copy from GPU to CPU RAM
|
||||
|
@ -512,7 +511,6 @@ static CaptureResult dxgi_capture(bool * hasFrameUpdate, bool * hasPointerUpdate
|
|||
IDXGIResource_Release(res);
|
||||
return CAPTURE_RESULT_ERROR;
|
||||
}
|
||||
this->needsUnmap = true;
|
||||
|
||||
// signal that a frame is available
|
||||
os_signalEvent(this->frameEvent);
|
||||
|
|
Loading…
Reference in a new issue