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/179140
Reviewed-by: Shannon Woods <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/180450
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Jamie Madill <[email protected]>
This commit is contained in:
Jamie Madill committed 2013-12-17 20:21:25 +00:00
1 parent f11dbdb3b9
commit cd65ae1685
2 files changed
+9 -7

No files matched your search

+1 -1
View File
@@ -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)
{
+8 -6
View File
@@ -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;
}