diff src/video/win32/SDL_d3drender.c @ 3197:434ce3242e1c

Alexei Tereschenko Why not to use hardware vertex processing instead of software one if it is available in D3D render driver? With hardware processing testsprite2 runs three times faster on all videocards which I could test.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 16 Jun 2009 14:34:15 +0000
parents 8cc00819c8d6
children 7690aa2f5b74
line wrap: on
line diff
--- a/src/video/win32/SDL_d3drender.c	Fri Jun 12 08:41:48 2009 +0000
+++ b/src/video/win32/SDL_d3drender.c	Tue Jun 16 14:34:15 2009 +0000
@@ -412,9 +412,16 @@
         pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
     }
 
+    IDirect3D9_GetDeviceCaps(videodata->d3d, D3DADAPTER_DEFAULT,
+                             D3DDEVTYPE_HAL, &caps);
+
     result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT,        /* FIXME */
                                      D3DDEVTYPE_HAL,
                                      windowdata->hwnd,
+                                     (caps.
+                                      DevCaps &
+                                      D3DDEVCAPS_HWTRANSFORMANDLIGHT) ?
+                                     D3DCREATE_HARDWARE_VERTEXPROCESSING :
                                      D3DCREATE_SOFTWARE_VERTEXPROCESSING,
                                      &pparams, &data->device);
     if (FAILED(result)) {