Enclose isDeviceLostError and checkDeviceLost in their corresponding d3d9/d3d11 namespaces.

TRAC #22411 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1854 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent dd2524c4
...@@ -62,7 +62,7 @@ GLboolean Fence9::testFence() ...@@ -62,7 +62,7 @@ GLboolean Fence9::testFence()
HRESULT result = mQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); HRESULT result = mQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
if (checkDeviceLost(result)) if (d3d9::checkDeviceLost(result))
{ {
return error(GL_OUT_OF_MEMORY, GL_TRUE); return error(GL_OUT_OF_MEMORY, GL_TRUE);
} }
...@@ -107,7 +107,7 @@ void Fence9::getFenceiv(GLenum pname, GLint *params) ...@@ -107,7 +107,7 @@ void Fence9::getFenceiv(GLenum pname, GLint *params)
HRESULT result = mQuery->GetData(NULL, 0, 0); HRESULT result = mQuery->GetData(NULL, 0, 0);
if (checkDeviceLost(result)) if (d3d9::checkDeviceLost(result))
{ {
params[0] = GL_TRUE; params[0] = GL_TRUE;
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
......
...@@ -108,7 +108,7 @@ GLboolean Query9::testQuery() ...@@ -108,7 +108,7 @@ GLboolean Query9::testQuery()
ASSERT(false); ASSERT(false);
} }
} }
else if (checkDeviceLost(hres)) else if (d3d9::checkDeviceLost(hres))
{ {
return error(GL_OUT_OF_MEMORY, GL_TRUE); return error(GL_OUT_OF_MEMORY, GL_TRUE);
} }
......
...@@ -634,7 +634,7 @@ void Renderer9::sync(bool block) ...@@ -634,7 +634,7 @@ void Renderer9::sync(bool block)
freeEventQuery(query); freeEventQuery(query);
if (isDeviceLostError(result)) if (d3d9::isDeviceLostError(result))
{ {
mDisplay->notifyDeviceLost(); mDisplay->notifyDeviceLost();
} }
...@@ -2705,7 +2705,7 @@ void Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsiz ...@@ -2705,7 +2705,7 @@ void Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsiz
// It turns out that D3D will sometimes produce more error // It turns out that D3D will sometimes produce more error
// codes than those documented. // codes than those documented.
if (checkDeviceLost(result)) if (d3d9::checkDeviceLost(result))
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
else else
{ {
......
...@@ -264,7 +264,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap ...@@ -264,7 +264,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap
ERR("Could not create offscreen texture: %08lX", result); ERR("Could not create offscreen texture: %08lX", result);
release(); release();
if (isDeviceLostError(result)) if (d3d11::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
...@@ -348,7 +348,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap ...@@ -348,7 +348,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap
ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result); ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result);
release(); release();
if (isDeviceLostError(result)) if (d3d11::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
...@@ -388,7 +388,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap ...@@ -388,7 +388,7 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap
ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result); ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result);
release(); release();
if (isDeviceLostError(result)) if (d3d11::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
......
...@@ -143,7 +143,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI ...@@ -143,7 +143,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI
ERR("Could not create offscreen texture: %08lX", result); ERR("Could not create offscreen texture: %08lX", result);
release(); release();
if(isDeviceLostError(result)) if (d3d9::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
...@@ -223,7 +223,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI ...@@ -223,7 +223,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI
ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result); ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result);
release(); release();
if(isDeviceLostError(result)) if (d3d9::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
...@@ -251,7 +251,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI ...@@ -251,7 +251,7 @@ EGLint SwapChain9::reset(int backbufferWidth, int backbufferHeight, EGLint swapI
ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result); ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result);
release(); release();
if (isDeviceLostError(result)) if (d3d9::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
...@@ -339,7 +339,7 @@ EGLint SwapChain9::swapRect(EGLint x, EGLint y, EGLint width, EGLint height) ...@@ -339,7 +339,7 @@ EGLint SwapChain9::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty();
if (isDeviceLostError(result)) if (d3d9::isDeviceLostError(result))
{ {
return EGL_CONTEXT_LOST; return EGL_CONTEXT_LOST;
} }
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
// renderer11_utils.h: Conversion functions and other utility routines // renderer11_utils.h: Conversion functions and other utility routines
// specific to the D3D11 renderer. // specific to the D3D11 renderer.
#ifndef LIBGLESV2_RENDERER_RENDERER11_UTILS_H
#define LIBGLESV2_RENDERER_RENDERER11_UTILS_H
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
...@@ -70,7 +73,6 @@ size_t ComputeBlockSizeBits(DXGI_FORMAT format); ...@@ -70,7 +73,6 @@ size_t ComputeBlockSizeBits(DXGI_FORMAT format);
bool IsDepthStencilFormat(DXGI_FORMAT format); bool IsDepthStencilFormat(DXGI_FORMAT format);
HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name); HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name);
}
inline bool isDeviceLostError(HRESULT errorCode) inline bool isDeviceLostError(HRESULT errorCode)
{ {
...@@ -86,3 +88,7 @@ inline bool isDeviceLostError(HRESULT errorCode) ...@@ -86,3 +88,7 @@ inline bool isDeviceLostError(HRESULT errorCode)
return false; return false;
} }
} }
}
#endif // LIBGLESV2_RENDERER_RENDERER11_UTILS_H
...@@ -60,7 +60,6 @@ namespace d3d9 ...@@ -60,7 +60,6 @@ namespace d3d9
{ {
bool IsCompressedFormat(D3DFORMAT format); bool IsCompressedFormat(D3DFORMAT format);
size_t ComputeRowSize(D3DFORMAT format, unsigned int width); size_t ComputeRowSize(D3DFORMAT format, unsigned int width);
}
inline bool isDeviceLostError(HRESULT errorCode) inline bool isDeviceLostError(HRESULT errorCode)
{ {
...@@ -89,4 +88,6 @@ inline bool checkDeviceLost(HRESULT errorCode) ...@@ -89,4 +88,6 @@ inline bool checkDeviceLost(HRESULT errorCode)
return false; return false;
}; };
}
#endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H #endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H
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