diff --git a/src/libGLESv2/renderer/d3d9/Renderer9.cpp b/src/libGLESv2/renderer/d3d9/Renderer9.cpp index 56335648b..87e64202e 100644 --- a/src/libGLESv2/renderer/d3d9/Renderer9.cpp +++ b/src/libGLESv2/renderer/d3d9/Renderer9.cpp @@ -2113,7 +2113,7 @@ bool Renderer9::isDeviceLost() bool Renderer9::testDeviceLost(bool notify) { HRESULT status = getDeviceStatusCode(); - bool isLost = (FAILED(status) || d3d9::isDeviceLostError(status)); + bool isLost = FAILED(status); if (isLost) { diff --git a/src/libGLESv2/renderer/d3d9/SwapChain9.cpp b/src/libGLESv2/renderer/d3d9/SwapChain9.cpp index 787274ef7..1d75876e4 100644 --- a/src/libGLESv2/renderer/d3d9/SwapChain9.cpp +++ b/src/libGLESv2/renderer/d3d9/SwapChain9.cpp @@ -311,17 +311,19 @@ EGLint SwapChain9::swapRect(EGLint x, EGLint y, EGLint width, EGLint height) mRenderer->markAllStateDirty(); - if (d3d9::isDeviceLostError(result)) - { - return EGL_CONTEXT_LOST; - } - if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DRIVERINTERNALERROR) { return EGL_BAD_ALLOC; } - ASSERT(SUCCEEDED(result)); + // http://crbug.com/313210 + // If our swap failed, trigger a device lost event. Resetting will work around an AMD-specific + // device removed bug with lost contexts when reinstalling drivers. + if (FAILED(result)) + { + mRenderer->notifyDeviceLost(); + return EGL_CONTEXT_LOST; + } return EGL_SUCCESS; }