Support software vertex processing

TRAC #11632 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@84 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4388487c
...@@ -56,7 +56,7 @@ bool Display::initialize() ...@@ -56,7 +56,7 @@ bool Display::initialize()
return error(EGL_BAD_ALLOC, false); return error(EGL_BAD_ALLOC, false);
} }
if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0) || caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0))
{ {
mD3d9->Release(); mD3d9->Release();
mD3d9 = NULL; mD3d9 = NULL;
...@@ -216,8 +216,6 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config) ...@@ -216,8 +216,6 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
{ {
const egl::Config *configuration = mConfigSet.get(config); const egl::Config *configuration = mConfigSet.get(config);
UINT adapter = D3DADAPTER_DEFAULT;
D3DDEVTYPE deviceType = D3DDEVTYPE_HAL;
D3DPRESENT_PARAMETERS presentParameters = {0}; D3DPRESENT_PARAMETERS presentParameters = {0};
presentParameters.AutoDepthStencilFormat = configuration->mDepthStencilFormat; presentParameters.AutoDepthStencilFormat = configuration->mDepthStencilFormat;
...@@ -239,13 +237,27 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config) ...@@ -239,13 +237,27 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
if (!mDevice) if (!mDevice)
{ {
HRESULT result = mD3d9->CreateDevice(adapter, deviceType, window, D3DCREATE_FPU_PRESERVE | D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_NOWINDOWCHANGES, &presentParameters, &mDevice); UINT adapter = D3DADAPTER_DEFAULT;
D3DDEVTYPE deviceType = D3DDEVTYPE_HAL;
DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES;
HRESULT result = mD3d9->CreateDevice(adapter, deviceType, window, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{ {
return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
} }
if (FAILED(result))
{
result = mD3d9->CreateDevice(adapter, deviceType, window, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice);
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
{
return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
}
}
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
if (mDevice) if (mDevice)
......
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