Commit f4e85edb by apatrick@chromium.org

Do not attempt to recover from device lost masked by present occluded or display mode changed.

The call to IDirect3DDevice9::Present in testDeviceLost sometimes never returns on AMD, resulting in a hang. Also, on AMD, device lost is sometimes never reported at all, even through present occluded or display mode changed. I'll need to do something more robust at the app level. It has something to do with the Chrome GPU process sandbox. These issues only happen when the sandbox is enabled. Cleanup for Surface::recreateAdditionalSwapChains to follow once I determine this gets us back to a stable place. Review URL: https://codereview.appspot.com/8038044 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2040 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0e9f56c8
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 2001
#define BUILD_REVISION 2040
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -916,34 +916,7 @@ bool Display::testDeviceLost()
if (mDeviceEx)
{
HRESULT hr = mDeviceEx->CheckDeviceState(NULL);
if (hr == S_PRESENT_MODE_CHANGED)
{
// Reset the device so that D3D stops reporting S_PRESENT_MODE_CHANGED. Otherwise it will report
// it continuously, potentially masking a lost device. D3D resources are not lost on a mode change with WDDM.
D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters();
mDeviceEx->Reset(&presentParameters);
// Existing swap chains sometimes crash on the next present after a reset.
for (SurfaceSet::iterator it = mSurfaceSet.begin(); it != mSurfaceSet.end(); ++it)
{
(*it)->recreateAdditionalSwapChain();
}
// Reset will not always cause the device loss to be reported so issue a dummy present.
mDeviceEx->Present(NULL, NULL, NULL, NULL);
// Retest the device status to see if the mode change really indicated a lost device.
hr = mDeviceEx->CheckDeviceState(NULL);
}
else if (hr == S_PRESENT_OCCLUDED)
{
// CheckDeviceLost continuously returns S_PRESENT_OCCLUDED while the screen is locked. Calling Present
// unmasks the device lost error.
mDeviceEx->Present(NULL, NULL, NULL, NULL);
hr = mDeviceEx->CheckDeviceState(NULL);
}
isLost = FAILED(hr);
isLost = FAILED(mDeviceEx->CheckDeviceState(NULL));
}
else if (mDevice)
{
......
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