win32: fall back to software vertex processing if d3d9 init fails

This commit is contained in:
OV2 2012-12-18 21:17:08 +01:00
parent 60dd07364e
commit 681241deb5
2 changed files with 15 additions and 3 deletions

View File

@ -119,7 +119,19 @@ void D3DVideo::init_base(const video_info_t &info)
&d3dpp,
&dev)))
{
throw std::runtime_error("Failed to init device");
RARCH_WARN("[D3D9]: Failed to init device with hardware vertex processing (code: 0x%x). Trying to fall back to software vertex processing.\n",
(unsigned)Callback::d3d_err);
if (FAILED(Callback::d3d_err = g_pD3D->CreateDevice(
Monitor::cur_mon_id,
D3DDEVTYPE_HAL,
hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&dev)))
{
throw std::runtime_error("Failed to init device");
}
}
}

View File

@ -101,7 +101,7 @@ void RenderChain::add_pass(const LinkInfo &info)
if (FAILED(dev->CreateVertexBuffer(
4 * sizeof(Vertex),
0,
dev->GetSoftwareVertexProcessing() ? D3DUSAGE_SOFTWAREPROCESSING : 0,
FVF,
D3DPOOL_DEFAULT,
&pass.vertex_buf,
@ -279,7 +279,7 @@ void RenderChain::create_first_pass(const LinkInfo &info, PixelFormat fmt)
if (FAILED(dev->CreateVertexBuffer(
4 * sizeof(Vertex),
0,
dev->GetSoftwareVertexProcessing() ? D3DUSAGE_SOFTWAREPROCESSING : 0,
FVF,
D3DPOOL_DEFAULT,
&prev.vertex_buf[i],