Skip to content

Commit

Permalink
[host] dxgi: fix failure to reset texture state on fast restarts
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Nov 15, 2023
1 parent a0fd03d commit accf300
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions host/platform/Windows/capture/DXGI/src/dxgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,20 @@ static bool dxgi_deinit(void)
for (int i = 0; i < this->maxTextures; ++i)
{
Texture * tex = &this->texture[i];
if (!tex->map)
continue;
this->backend->unmapTexture(i);
tex->map = NULL;
tex->state = TEXTURE_STATE_UNUSED;
switch(tex->state)
{
case TEXTURE_STATE_MAPPED:
this->backend->unmapTexture(i);
tex->map = NULL;
//fallthrough

case TEXTURE_STATE_PENDING_MAP:
tex->state = TEXTURE_STATE_UNUSED;
//fallthrough

case TEXTURE_STATE_UNUSED:
break;
}
}

if (this->dup && *this->dup)
Expand Down

0 comments on commit accf300

Please sign in to comment.