mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-25 00:12:44 +00:00
[host] dxgi: clean up failed frame writes
This commit is contained in:
@@ -1516,12 +1516,13 @@ static CaptureResult dxgi_getFrame(
|
|||||||
|
|
||||||
Texture * tex = &this->texture[this->texRIndex];
|
Texture * tex = &this->texture[this->texRIndex];
|
||||||
FrameDamage * damage = &this->frameDamage[frameBufferIndex];
|
FrameDamage * damage = &this->frameDamage[frameBufferIndex];
|
||||||
|
CaptureResult result = CAPTURE_RESULT_OK;
|
||||||
|
|
||||||
if (this->backend->writeFrame)
|
if (this->backend->writeFrame)
|
||||||
{
|
{
|
||||||
CaptureResult result = this->backend->writeFrame(frameBufferIndex, frame);
|
result = this->backend->writeFrame(frameBufferIndex, frame);
|
||||||
if (result != CAPTURE_RESULT_OK)
|
if (result != CAPTURE_RESULT_OK)
|
||||||
return result;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1584,6 +1585,7 @@ static CaptureResult dxgi_getFrame(
|
|||||||
damage->count = -1;
|
damage->count = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
this->backend->unmapTexture(this->texRIndex);
|
this->backend->unmapTexture(this->texRIndex);
|
||||||
tex->map = NULL;
|
tex->map = NULL;
|
||||||
tex->state = TEXTURE_STATE_UNUSED;
|
tex->state = TEXTURE_STATE_UNUSED;
|
||||||
@@ -1591,7 +1593,7 @@ static CaptureResult dxgi_getFrame(
|
|||||||
if (++this->texRIndex == this->maxTextures)
|
if (++this->texRIndex == this->maxTextures)
|
||||||
this->texRIndex = 0;
|
this->texRIndex = 0;
|
||||||
|
|
||||||
return CAPTURE_RESULT_OK;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CaptureResult dxgi_releaseFrame(void)
|
static CaptureResult dxgi_releaseFrame(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user