Check device loss between GetData calls when blocking

Trac #19246 Issue=262 Some drivers don't properly return device lost Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@924 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent df363721
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 923
#define BUILD_REVISION 924
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -2868,6 +2868,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *
// Implements glFlush when block is false, glFinish when block is true
void Context::sync(bool block)
{
egl::Display *display = getDisplay();
IDirect3DQuery9 *eventQuery = NULL;
HRESULT result;
......@@ -2900,6 +2901,13 @@ void Context::sync(bool block)
{
// Keep polling, but allow other threads to do something useful first
Sleep(0);
// explicitly check for device loss
// some drivers seem to return S_FALSE even if the device is lost
// instead of D3DERR_DEVICELOST like they should
if (display->testDeviceLost())
{
result = D3DERR_DEVICELOST;
}
}
}
while(block && result == S_FALSE);
......
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