Alexei Tereschenko
authorSam Lantinga <slouken@libsdl.org>
Tue, 16 Jun 2009 14:34:15 +0000
changeset 3197434ce3242e1c
parent 3196 413672b09bb3
child 3198 fefe74ca604d
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.
src/video/win32/SDL_d3drender.c
     1.1 --- a/src/video/win32/SDL_d3drender.c	Fri Jun 12 08:41:48 2009 +0000
     1.2 +++ b/src/video/win32/SDL_d3drender.c	Tue Jun 16 14:34:15 2009 +0000
     1.3 @@ -412,9 +412,16 @@
     1.4          pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
     1.5      }
     1.6  
     1.7 +    IDirect3D9_GetDeviceCaps(videodata->d3d, D3DADAPTER_DEFAULT,
     1.8 +                             D3DDEVTYPE_HAL, &caps);
     1.9 +
    1.10      result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT,        /* FIXME */
    1.11                                       D3DDEVTYPE_HAL,
    1.12                                       windowdata->hwnd,
    1.13 +                                     (caps.
    1.14 +                                      DevCaps &
    1.15 +                                      D3DDEVCAPS_HWTRANSFORMANDLIGHT) ?
    1.16 +                                     D3DCREATE_HARDWARE_VERTEXPROCESSING :
    1.17                                       D3DCREATE_SOFTWARE_VERTEXPROCESSING,
    1.18                                       &pparams, &data->device);
    1.19      if (FAILED(result)) {