Commit e98df4fd by Jamie Madill

Trigger lost device on an error in D3D9 Present.

This fixes device remove handling on AMD systems, as well as notifying the app layer there may have been an internal problem during Present. BUG=313210 Change-Id: I843ffb3946dd9ef34fbd24b3a46a7b97e3c0fd16 Reviewed-on: https://chromium-review.googlesource.com/179140Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent d5340405
...@@ -2067,7 +2067,7 @@ bool Renderer9::isDeviceLost() ...@@ -2067,7 +2067,7 @@ bool Renderer9::isDeviceLost()
bool Renderer9::testDeviceLost(bool notify) bool Renderer9::testDeviceLost(bool notify)
{ {
HRESULT status = getDeviceStatusCode(); HRESULT status = getDeviceStatusCode();
bool isLost = (FAILED(status) || d3d9::isDeviceLostError(status)); bool isLost = FAILED(status);
if (isLost) if (isLost)
{ {
......
...@@ -351,17 +351,19 @@ EGLint SwapChain9::swapRect(EGLint x, EGLint y, EGLint width, EGLint height) ...@@ -351,17 +351,19 @@ EGLint SwapChain9::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty();
if (d3d9::isDeviceLostError(result))
{
return EGL_CONTEXT_LOST;
}
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DRIVERINTERNALERROR) if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DRIVERINTERNALERROR)
{ {
return EGL_BAD_ALLOC; 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; return EGL_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment