Fix backbuffer RTV not recreating properly if Desc->Format is UNKNOWN

* Judging by the error reports that pointed to this crash, this happens
  with the Dolphin emulator.
This commit is contained in:
baldurk
2014-05-26 13:49:47 +01:00
parent 827fae3a67
commit 07d16672a4
@@ -870,6 +870,14 @@ bool WrappedID3D11Device::Serialise_CreateRenderTargetView(
backbufferTypedDesc.Texture2D.MipSlice = 0;
pDesc = &backbufferTypedDesc;
}
// if we have a descriptor but it specifies DXGI_FORMAT_UNKNOWN format, that means use
// the texture's format. But as above, we fudge around the typeless backbuffer so we
// have to set the correct typed format
if(HasDesc && pDesc->Format == DXGI_FORMAT_UNKNOWN && tex2d->m_RealDescriptor)
{
pDesc->Format = tex2d->m_RealDescriptor->Format;
}
HRESULT hr = m_pDevice->CreateRenderTargetView(GetResourceManager()->UnwrapResource(live), pDesc, &ret);