From dd86ee0d76363e56ffb524fbad3f52be5f0ba804 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jun 2009 14:34:15 +0000 Subject: [PATCH] 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. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403658 --- src/video/win32/SDL_d3drender.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video/win32/SDL_d3drender.c b/src/video/win32/SDL_d3drender.c index c74cd5357..65f9843be 100644 --- a/src/video/win32/SDL_d3drender.c +++ b/src/video/win32/SDL_d3drender.c @@ -412,9 +412,16 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) 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)) {