comparison 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
comparison
equal deleted inserted replaced
3196:413672b09bb3 3197:434ce3242e1c
410 pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; 410 pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
411 } else { 411 } else {
412 pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; 412 pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
413 } 413 }
414 414
415 IDirect3D9_GetDeviceCaps(videodata->d3d, D3DADAPTER_DEFAULT,
416 D3DDEVTYPE_HAL, &caps);
417
415 result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT, /* FIXME */ 418 result = IDirect3D9_CreateDevice(videodata->d3d, D3DADAPTER_DEFAULT, /* FIXME */
416 D3DDEVTYPE_HAL, 419 D3DDEVTYPE_HAL,
417 windowdata->hwnd, 420 windowdata->hwnd,
421 (caps.
422 DevCaps &
423 D3DDEVCAPS_HWTRANSFORMANDLIGHT) ?
424 D3DCREATE_HARDWARE_VERTEXPROCESSING :
418 D3DCREATE_SOFTWARE_VERTEXPROCESSING, 425 D3DCREATE_SOFTWARE_VERTEXPROCESSING,
419 &pparams, &data->device); 426 &pparams, &data->device);
420 if (FAILED(result)) { 427 if (FAILED(result)) {
421 D3D_DestroyRenderer(renderer); 428 D3D_DestroyRenderer(renderer);
422 D3D_SetError("CreateDevice()", result); 429 D3D_SetError("CreateDevice()", result);