[host] dxgi: fix failure to reset texture state on fast restarts

This commit is contained in:
Geoffrey McRae 2023-11-15 17:31:10 +11:00
parent a0fd03d328
commit accf300c6c

View File

@ -885,11 +885,20 @@ static bool dxgi_deinit(void)
for (int i = 0; i < this->maxTextures; ++i) for (int i = 0; i < this->maxTextures; ++i)
{ {
Texture * tex = &this->texture[i]; Texture * tex = &this->texture[i];
if (!tex->map) switch(tex->state)
continue; {
case TEXTURE_STATE_MAPPED:
this->backend->unmapTexture(i); this->backend->unmapTexture(i);
tex->map = NULL; tex->map = NULL;
//fallthrough
case TEXTURE_STATE_PENDING_MAP:
tex->state = TEXTURE_STATE_UNUSED; tex->state = TEXTURE_STATE_UNUSED;
//fallthrough
case TEXTURE_STATE_UNUSED:
break;
}
} }
if (this->dup && *this->dup) if (this->dup && *this->dup)