Commit f0f46772 by Geoff Lang Committed by Commit Bot

D3D9: Log the exact error code generated by D3D9 device creation.

BUG=1029091 Change-Id: I552627dd18d0d5b48c02bff12c9368c724a65f54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1947448Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent ff83dabf
...@@ -306,11 +306,17 @@ egl::Error Renderer9::initialize() ...@@ -306,11 +306,17 @@ egl::Error Renderer9::initialize()
mAdapter, mDeviceType, mDeviceWindow, mAdapter, mDeviceType, mDeviceWindow,
behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE,
&presentParameters, &mDevice); &presentParameters, &mDevice);
if (FAILED(result))
{
ERR() << "CreateDevice1 failed: (" << gl::FmtHR(result) << ")";
}
} }
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DEVICELOST) if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DEVICELOST)
{ {
return egl::EglBadAlloc(D3D9_INIT_OUT_OF_MEMORY) return egl::EglBadAlloc(D3D9_INIT_OUT_OF_MEMORY)
<< "CreateDevice failed: device lost of out of memory"; << "CreateDevice failed: device lost or out of memory (" << gl::FmtHR(result)
<< ")";
} }
if (FAILED(result)) if (FAILED(result))
...@@ -325,7 +331,8 @@ egl::Error Renderer9::initialize() ...@@ -325,7 +331,8 @@ egl::Error Renderer9::initialize()
ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY ||
result == D3DERR_NOTAVAILABLE || result == D3DERR_DEVICELOST); result == D3DERR_NOTAVAILABLE || result == D3DERR_DEVICELOST);
return egl::EglBadAlloc(D3D9_INIT_OUT_OF_MEMORY) return egl::EglBadAlloc(D3D9_INIT_OUT_OF_MEMORY)
<< "CreateDevice2 failed: device lost, not available, or of out of memory"; << "CreateDevice2 failed: device lost, not available, or of out of memory ("
<< gl::FmtHR(result) << ")";
} }
} }
......
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