Bug 624088: Recreate our device agressively on device losses. r=jrmuizel a=joedrew

This commit is contained in:
Bas Schouten 2011-01-17 21:28:24 +00:00
parent 3312febc09
commit f7657faacd

View File

@ -525,29 +525,11 @@ DeviceManagerD3D9::VerifyReadyForRendering()
if (IsD3D9Ex()) {
hr = mDeviceEx->CheckDeviceState(mFocusWnd);
if (hr == D3DERR_DEVICEREMOVED) {
if (FAILED(hr)) {
mDeviceWasRemoved = true;
LayerManagerD3D9::OnDeviceManagerDestroy(this);
return false;
}
if (FAILED(hr)) {
D3DPRESENT_PARAMETERS pp;
memset(&pp, 0, sizeof(D3DPRESENT_PARAMETERS));
pp.BackBufferWidth = 1;
pp.BackBufferHeight = 1;
pp.BackBufferFormat = D3DFMT_A8R8G8B8;
pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
pp.Windowed = TRUE;
pp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
pp.hDeviceWindow = mFocusWnd;
hr = mDeviceEx->ResetEx(&pp, NULL);
if (FAILED(hr)) {
return false;
}
}
}
return true;
}