Commit 91d72e08 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

d3dx10/tests: Dynamically load d3d10 and skip if it's not present.

parent 67ee1d3f
TESTDLL = d3dx10_43.dll TESTDLL = d3dx10_43.dll
IMPORTS = d3dx10 d3d10 IMPORTS = d3dx10
C_SRCS = \ C_SRCS = \
d3dx10.c d3dx10.c
...@@ -41,12 +41,21 @@ static BOOL compare_float(float f, float g, unsigned int ulps) ...@@ -41,12 +41,21 @@ static BOOL compare_float(float f, float g, unsigned int ulps)
static ID3D10Device *create_device(void) static ID3D10Device *create_device(void)
{ {
ID3D10Device *device; ID3D10Device *device;
HMODULE d3d10_mod = LoadLibraryA("d3d10.dll");
HRESULT (WINAPI *pD3D10CreateDevice)(IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT, UINT, ID3D10Device **);
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device))) if (!d3d10_mod)
{
win_skip("d3d10.dll not present\n");
return NULL;
}
pD3D10CreateDevice = (void *)GetProcAddress(d3d10_mod, "D3D10CreateDevice");
if (SUCCEEDED(pD3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device)))
return device; return device;
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device))) if (SUCCEEDED(pD3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device)))
return device; return device;
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device))) if (SUCCEEDED(pD3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device)))
return device; return device;
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment