Catch all CreateOffscreenPlainSurface errors in readPixels

Issue=194 TRAC #17748 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@719 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4e4b807d
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 715 #define BUILD_REVISION 719
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -2138,16 +2138,16 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum ...@@ -2138,16 +2138,16 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
IDirect3DSurface9 *systemSurface; IDirect3DSurface9 *systemSurface;
HRESULT result = device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &systemSurface, NULL); HRESULT result = device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &systemSurface, NULL);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) if (FAILED(result))
{ {
ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
ASSERT(SUCCEEDED(result));
if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) if (desc.MultiSampleType != D3DMULTISAMPLE_NONE)
{ {
UNIMPLEMENTED(); // FIXME: Requires resolve using StretchRect into non-multisampled render target UNIMPLEMENTED(); // FIXME: Requires resolve using StretchRect into non-multisampled render target
return error(GL_OUT_OF_MEMORY);
} }
result = device->GetRenderTargetData(renderTarget, systemSurface); result = device->GetRenderTargetData(renderTarget, systemSurface);
......
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