When CheckDeviceState returns S_PRESENT_OCCLUDED, Present a dummy frame and try again.
This is to avoid a hang in glFinish in the event that the GPU hangs while the screen is locked.
To repro, modify this sample so that it waits a few seconds before hanging the GPU.
After initiating the GPU hang, quickly lock the screen. The GPU will reset but ANGLE only ever sees S_PRESENT_OCCLUDED followed by D3DERR_NOERROR. It never sees the device lost error.
Calling Present while the screen is locked seems to make CheckDeviceState return the device lost.
Doing the extra Present in testDeviceLost every time did not work well because it is very slow, perhaps because D3D delays presents to hidden windows to throttle the app.
Review URL: https://codereview.appspot.com/7911044
git-svn-id: http://angleproject.googlecode.com/svn/trunk@2001 736b8ea6-26fd-11df-bfd4-992fa37f6226
2 files changed