From: Elizabeth Figura zfigura@codeweavers.com
Test various things which some applications are sensitive to: device names, enumeration order, specific caps. Also show that HAL caps for non-HAL devices and HEL caps for HAL devices are nearly empty.
Most of these tests already pass on real Windows 98, but one modification was necessary to remove a positive test for HWTRANSFORMANDLIGHT from d3d1-4 devices, which real cards don't always expose. --- dlls/ddraw/tests/ddraw1.c | 195 ++++++++++++++++-------------- dlls/ddraw/tests/ddraw2.c | 193 +++++++++++++++++++----------- dlls/ddraw/tests/ddraw4.c | 243 ++++++++++++++++++++++---------------- dlls/ddraw/tests/ddraw7.c | 12 ++ 4 files changed, 384 insertions(+), 259 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index b864e58ab36..b8716a1b956 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -15462,165 +15462,179 @@ static void test_filling_convention(void) DestroyWindow(window); }
+static unsigned int enum_devices_index; + static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_desc, char *device_name, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx) { + static const D3DLIGHTINGCAPS empty_lighting_caps = {.dwSize = sizeof(D3DLIGHTINGCAPS)}; + static const D3DPRIMCAPS empty_primitive_caps = {.dwSize = sizeof(D3DPRIMCAPS)}; + IDirectDraw *ddraw = ctx; + + todo_wine ok(hal->dwSize == offsetof(D3DDEVICEDESC, dwMinTextureWidth), "Got size %lu.\n", hal->dwSize); + todo_wine ok(hel->dwSize == offsetof(D3DDEVICEDESC, dwMinTextureWidth), "Got size %lu.\n", hel->dwSize); + ok(hal->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS) + || (ddraw_is_warp(ddraw) && !hal->dtcTransformCaps.dwSize), + "Got transform caps size %lu.\n", hal->dtcTransformCaps.dwSize); + ok(hel->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS), + "Got transform caps size %lu.\n", hel->dtcTransformCaps.dwSize); + ok(hal->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS) + || (ddraw_is_warp(ddraw) && !hal->dlcLightingCaps.dwSize), + "Got lighting caps size %lu.\n", hal->dlcLightingCaps.dwSize); + ok(hel->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS), + "Got lighting caps size %lu.\n", hel->dlcLightingCaps.dwSize); + ok(hal->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hal->dpcLineCaps.dwSize); + ok(hel->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hel->dpcLineCaps.dwSize); + ok(hal->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hal->dpcTriCaps.dwSize); + ok(hel->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hel->dpcTriCaps.dwSize); + + if (!IsEqualGUID(guid, &IID_IDirect3DHALDevice)) + { + ok(!hal->dwFlags, "Got HAL flags %#lx.\n", hal->dwFlags); + ok(!hal->dcmColorModel, "Got color model %#lx.\n", hal->dcmColorModel); + todo_wine ok(!hal->dwDevCaps, "Got device caps %#lx.\n", hal->dwDevCaps); + todo_wine ok(!hal->dtcTransformCaps.dwCaps, "Got transform caps %#lx.\n", hal->dtcTransformCaps.dwCaps); + todo_wine ok(!hal->bClipping, "Got clipping %#x.\n", hal->bClipping); + todo_wine ok(!memcmp(&hal->dlcLightingCaps, &empty_lighting_caps, sizeof(D3DLIGHTINGCAPS)), + "Lighting caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hal->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hal->dwDeviceRenderBitDepth); + todo_wine ok(!hal->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hal->dwDeviceZBufferBitDepth); + ok(!hal->dwMaxBufferSize, "Got max buffer size %lu.\n", hal->dwMaxBufferSize); + todo_wine ok(!hal->dwMaxVertexCount, "Got max vertex count %lu.\n", hal->dwMaxVertexCount); + } + if(IsEqualGUID(&IID_IDirect3DRGBDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING + | D3DDD_TRICAPS + | D3DDD_DEVICERENDERBITDEPTH + | D3DDD_DEVICEZBUFFERBITDEPTH + | D3DDD_MAXBUFFERSIZE + | D3DDD_MAXVERTEXCOUNT; + + static const DWORD device_caps = D3DDEVCAPS_FLOATTLVERTEX + | D3DDEVCAPS_SORTINCREASINGZ + | D3DDEVCAPS_SORTEXACT + | D3DDEVCAPS_EXECUTESYSTEMMEMORY + | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY + | D3DDEVCAPS_TEXTURESYSTEMMEMORY + | D3DDEVCAPS_DRAWPRIMTLVERTEX; + + todo_wine ok(enum_devices_index == 1, "Expected index %u.\n", enum_devices_index); + todo_wine ok(!strcmp(device_name, "RGB Emulation"), "Got name %s.\n", debugstr_a(device_name)); + + todo_wine ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(hel->dcmColorModel == D3DCOLOR_RGB, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == device_caps, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "RGB Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_RGB, "RGB Device hel caps has colormodel %lu\n", hel->dcmColorModel); - - ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING; + + todo_wine ok(enum_devices_index == 2, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Direct3D HAL"), "Got name %s.\n", debugstr_a(device_name)); + ok(hal->dcmColorModel == D3DCOLOR_RGB, "HAL Device hal caps has colormodel %lu\n", hel->dcmColorModel); - ok(hel->dcmColorModel == 0, "HAL Device hel caps has colormodel %lu\n", hel->dcmColorModel);
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, - "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + + todo_wine ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(!hel->dcmColorModel, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == D3DDEVCAPS_FLOATTLVERTEX, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dtcTransformCaps.dwCaps == D3DTRANSFORMCAPS_CLIP, + "Got transform caps %#lx.\n", hel->dtcTransformCaps.dwCaps); + ok(hel->bClipping == TRUE, "Got clipping %#x.\n", hel->bClipping); + ok(hel->dlcLightingCaps.dwCaps == (D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT + | D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT), + "Got lighting caps %#lx.\n", hel->dlcLightingCaps.dwCaps); + ok(hel->dlcLightingCaps.dwLightingModel == D3DLIGHTINGMODEL_RGB, + "Got lighting model %#lx.\n", hel->dlcLightingCaps.dwLightingModel); + todo_wine ok(!hel->dlcLightingCaps.dwNumLights, + "Got light count %lu.\n", hel->dlcLightingCaps.dwNumLights); + todo_wine ok(!memcmp(&hel->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hel->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hel->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hel->dwDeviceRenderBitDepth); + todo_wine ok(!hel->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hel->dwDeviceZBufferBitDepth); + ok(!hel->dwMaxBufferSize, "Got max buffer size %lu.\n", hel->dwMaxBufferSize); + ok(hel->dwMaxVertexCount == hal->dwMaxVertexCount, "Got HAL max vertex count %lu, HEL %lu.\n", + hal->dwMaxVertexCount, hel->dwMaxVertexCount); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "REF Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "REF Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "REF Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "REF Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "REF Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "REF Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + ok(enum_devices_index == 0, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Ramp Emulation"), "Got name %s.\n", debugstr_a(device_name)); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "Ramp Device hal caps has colormodel %lu\n", hal->dcmColorModel); ok(hel->dcmColorModel == D3DCOLOR_MONO, "Ramp Device hel caps has colormodel %lu\n", hel->dcmColorModel);
- ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } - else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) - { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - - ok(hal->dcmColorModel == 0, "MMX Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_RGB, "MMX Device hel caps has colormodel %lu\n", hel->dcmColorModel); - - ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - } else { ok(FALSE, "Unexpected device enumerated: "%s" "%s"\n", device_desc, device_name); @@ -15642,6 +15656,7 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d trace("hel tri does NOT have pow2 set\n"); }
+ ++enum_devices_index; return DDENUMRET_OK; }
@@ -15666,7 +15681,7 @@ static void test_enum_devices(void) hr = IDirect3D_EnumDevices(d3d, NULL, NULL); ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
- hr = IDirect3D_EnumDevices(d3d, test_enum_devices_caps_callback, NULL); + hr = IDirect3D_EnumDevices(d3d, test_enum_devices_caps_callback, ddraw); ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
IDirect3D_Release(d3d); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index aaa9fd1cbdd..f8dbc387475 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -16457,162 +16457,216 @@ static void test_filling_convention(void) DestroyWindow(window); }
+static unsigned int enum_devices_index; + static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_desc, char *device_name, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx) { + static const D3DLIGHTINGCAPS empty_lighting_caps = {.dwSize = sizeof(D3DLIGHTINGCAPS)}; + static const D3DPRIMCAPS empty_primitive_caps = {.dwSize = sizeof(D3DPRIMCAPS)}; + IDirectDraw2 *ddraw = ctx; + + todo_wine ok(hal->dwSize == offsetof(D3DDEVICEDESC, dwMaxTextureRepeat), "Got size %lu.\n", hal->dwSize); + todo_wine ok(hel->dwSize == offsetof(D3DDEVICEDESC, dwMaxTextureRepeat), "Got size %lu.\n", hel->dwSize); + ok(hal->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS) + || (ddraw_is_warp(ddraw) && !hal->dtcTransformCaps.dwSize), + "Got transform caps size %lu.\n", hal->dtcTransformCaps.dwSize); + ok(hel->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS), + "Got transform caps size %lu.\n", hel->dtcTransformCaps.dwSize); + ok(hal->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS) + || (ddraw_is_warp(ddraw) && !hal->dlcLightingCaps.dwSize), + "Got lighting caps size %lu.\n", hal->dlcLightingCaps.dwSize); + ok(hel->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS), + "Got lighting caps size %lu.\n", hel->dlcLightingCaps.dwSize); + ok(hal->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hal->dpcLineCaps.dwSize); + ok(hel->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hel->dpcLineCaps.dwSize); + ok(hal->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hal->dpcTriCaps.dwSize); + ok(hel->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hel->dpcTriCaps.dwSize); + + if (!IsEqualGUID(guid, &IID_IDirect3DHALDevice)) + { + ok(!hal->dwFlags, "Got HAL flags %#lx.\n", hal->dwFlags); + ok(!hal->dcmColorModel, "Got color model %#lx.\n", hal->dcmColorModel); + todo_wine ok(!hal->dwDevCaps, "Got device caps %#lx.\n", hal->dwDevCaps); + todo_wine ok(!hal->dtcTransformCaps.dwCaps, "Got transform caps %#lx.\n", hal->dtcTransformCaps.dwCaps); + todo_wine ok(!hal->bClipping, "Got clipping %#x.\n", hal->bClipping); + todo_wine ok(!memcmp(&hal->dlcLightingCaps, &empty_lighting_caps, sizeof(D3DLIGHTINGCAPS)), + "Lighting caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hal->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hal->dwDeviceRenderBitDepth); + todo_wine ok(!hal->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hal->dwDeviceZBufferBitDepth); + ok(!hal->dwMaxBufferSize, "Got max buffer size %lu.\n", hal->dwMaxBufferSize); + todo_wine ok(!hal->dwMaxVertexCount, "Got max vertex count %lu.\n", hal->dwMaxVertexCount); + todo_wine ok(!hal->dwMinTextureWidth, "Got min texture width %lu.\n", hal->dwMinTextureWidth); + todo_wine ok(!hal->dwMinTextureHeight, "Got min texture height %lu.\n", hal->dwMinTextureHeight); + todo_wine ok(!hal->dwMaxTextureWidth, "Got max texture width %lu.\n", hal->dwMaxTextureWidth); + todo_wine ok(!hal->dwMaxTextureHeight, "Got max texture height %lu.\n", hal->dwMaxTextureHeight); + todo_wine ok(!hal->dwMinStippleWidth, "Got min stipple width %lu.\n", hal->dwMinStippleWidth); + todo_wine ok(!hal->dwMinStippleHeight, "Got min stipple height %lu.\n", hal->dwMinStippleHeight); + todo_wine ok(!hal->dwMaxStippleWidth, "Got max stipple width %lu.\n", hal->dwMaxStippleWidth); + todo_wine ok(!hal->dwMaxStippleHeight, "Got max stipple height %lu.\n", hal->dwMaxStippleHeight); + } + if(IsEqualGUID(&IID_IDirect3DRGBDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING + | D3DDD_TRICAPS + | D3DDD_DEVICERENDERBITDEPTH + | D3DDD_DEVICEZBUFFERBITDEPTH + | D3DDD_MAXBUFFERSIZE + | D3DDD_MAXVERTEXCOUNT; + + static const DWORD device_caps = D3DDEVCAPS_FLOATTLVERTEX + | D3DDEVCAPS_SORTINCREASINGZ + | D3DDEVCAPS_SORTEXACT + | D3DDEVCAPS_EXECUTESYSTEMMEMORY + | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY + | D3DDEVCAPS_TEXTURESYSTEMMEMORY + | D3DDEVCAPS_DRAWPRIMTLVERTEX; + + todo_wine ok(enum_devices_index == 1, "Expected index %u.\n", enum_devices_index); + todo_wine ok(!strcmp(device_name, "RGB Emulation"), "Got name %s.\n", debugstr_a(device_name)); + + todo_wine ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(hel->dcmColorModel == D3DCOLOR_RGB, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == device_caps, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "RGB Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_RGB, "RGB Device hel caps has colormodel %lu\n", hel->dcmColorModel); - - ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING; + + todo_wine ok(enum_devices_index == 2, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Direct3D HAL"), "Got name %s.\n", debugstr_a(device_name)); + ok(hal->dcmColorModel == D3DCOLOR_RGB, "HAL Device hal caps has colormodel %lu\n", hel->dcmColorModel); - ok(hel->dcmColorModel == 0, "HAL Device hel caps has colormodel %lu\n", hel->dcmColorModel);
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, - "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + + todo_wine ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(!hel->dcmColorModel, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == D3DDEVCAPS_FLOATTLVERTEX, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dtcTransformCaps.dwCaps == D3DTRANSFORMCAPS_CLIP, + "Got transform caps %#lx.\n", hel->dtcTransformCaps.dwCaps); + ok(hel->bClipping == TRUE, "Got clipping %#x.\n", hel->bClipping); + ok(hel->dlcLightingCaps.dwCaps == (D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT + | D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT), + "Got lighting caps %#lx.\n", hel->dlcLightingCaps.dwCaps); + ok(hel->dlcLightingCaps.dwLightingModel == D3DLIGHTINGMODEL_RGB, + "Got lighting model %#lx.\n", hel->dlcLightingCaps.dwLightingModel); + todo_wine ok(!hel->dlcLightingCaps.dwNumLights, + "Got light count %lu.\n", hel->dlcLightingCaps.dwNumLights); + todo_wine ok(!memcmp(&hel->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hel->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hel->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hel->dwDeviceRenderBitDepth); + todo_wine ok(!hel->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hel->dwDeviceZBufferBitDepth); + ok(!hel->dwMaxBufferSize, "Got max buffer size %lu.\n", hel->dwMaxBufferSize); + ok(hel->dwMaxVertexCount == hal->dwMaxVertexCount, "Got HAL max vertex count %lu, HEL %lu.\n", + hal->dwMaxVertexCount, hel->dwMaxVertexCount); + todo_wine ok(!hel->dwMinTextureWidth, "Got min texture width %lu.\n", hel->dwMinTextureWidth); + todo_wine ok(!hel->dwMinTextureHeight, "Got min texture height %lu.\n", hel->dwMinTextureHeight); + todo_wine ok(!hel->dwMaxTextureWidth, "Got max texture width %lu.\n", hel->dwMaxTextureWidth); + todo_wine ok(!hel->dwMaxTextureHeight, "Got max texture height %lu.\n", hel->dwMaxTextureHeight); + todo_wine ok(!hel->dwMinStippleWidth, "Got min stipple width %lu.\n", hel->dwMinStippleWidth); + todo_wine ok(!hel->dwMinStippleHeight, "Got min stipple height %lu.\n", hel->dwMinStippleHeight); + todo_wine ok(!hel->dwMaxStippleWidth, "Got max stipple width %lu.\n", hel->dwMaxStippleWidth); + todo_wine ok(!hel->dwMaxStippleHeight, "Got max stipple height %lu.\n", hel->dwMaxStippleHeight); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "REF Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "REF Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "REF Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "REF Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "REF Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "REF Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + ok(enum_devices_index == 0, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Ramp Emulation"), "Got name %s.\n", debugstr_a(device_name)); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "Ramp Device hal caps has colormodel %lu\n", hal->dcmColorModel); ok(hel->dcmColorModel == D3DCOLOR_MONO, "Ramp Device hel caps has colormodel %lu\n", hel->dcmColorModel);
- ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + ok(enum_devices_index == 3, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "MMX Emulation"), "Got name %s.\n", debugstr_a(device_name)); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "MMX Device hal caps has colormodel %lu\n", hal->dcmColorModel); ok(hel->dcmColorModel == D3DCOLOR_RGB, "MMX Device hel caps has colormodel %lu\n", hel->dcmColorModel);
- ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } @@ -16637,6 +16691,7 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d trace("hel tri does NOT have pow2 set\n"); }
+ ++enum_devices_index; return DDENUMRET_OK; }
@@ -16661,7 +16716,7 @@ static void test_enum_devices(void) hr = IDirect3D2_EnumDevices(d3d, NULL, NULL); ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
- hr = IDirect3D2_EnumDevices(d3d, test_enum_devices_caps_callback, NULL); + hr = IDirect3D2_EnumDevices(d3d, test_enum_devices_caps_callback, ddraw); ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
IDirect3D2_Release(d3d); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 6946ca71245..a6ea3231725 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -19550,64 +19550,177 @@ static void test_filling_convention(void) DestroyWindow(window); }
+static unsigned int enum_devices_index; + static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_desc, char *device_name, D3DDEVICEDESC *hal, D3DDEVICEDESC *hel, void *ctx) { + static const D3DLIGHTINGCAPS empty_lighting_caps = {.dwSize = sizeof(D3DLIGHTINGCAPS)}; + static const D3DPRIMCAPS empty_primitive_caps = {.dwSize = sizeof(D3DPRIMCAPS)}; + IDirectDraw4 *ddraw = ctx; + + ok(hal->dwSize == sizeof(D3DDEVICEDESC), "Got size %lu.\n", hal->dwSize); + ok(hel->dwSize == sizeof(D3DDEVICEDESC), "Got size %lu.\n", hel->dwSize); + ok(hal->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS) + || (ddraw_is_warp(ddraw) && !hal->dtcTransformCaps.dwSize), + "Got transform caps size %lu.\n", hal->dtcTransformCaps.dwSize); + ok(hel->dtcTransformCaps.dwSize == sizeof(D3DTRANSFORMCAPS), + "Got transform caps size %lu.\n", hel->dtcTransformCaps.dwSize); + ok(hal->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS) + || (ddraw_is_warp(ddraw) && !hal->dlcLightingCaps.dwSize), + "Got lighting caps size %lu.\n", hal->dlcLightingCaps.dwSize); + ok(hel->dlcLightingCaps.dwSize == sizeof(D3DLIGHTINGCAPS), + "Got lighting caps size %lu.\n", hel->dlcLightingCaps.dwSize); + ok(hal->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hal->dpcLineCaps.dwSize); + ok(hel->dpcLineCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got line caps size %lu.\n", hel->dpcLineCaps.dwSize); + ok(hal->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hal->dpcTriCaps.dwSize); + ok(hel->dpcTriCaps.dwSize == sizeof(D3DPRIMCAPS), + "Got triangle caps size %lu.\n", hel->dpcTriCaps.dwSize); + + if (!IsEqualGUID(guid, &IID_IDirect3DHALDevice)) + { + ok(!hal->dwFlags, "Got HAL flags %#lx.\n", hal->dwFlags); + ok(!hal->dcmColorModel, "Got color model %#lx.\n", hal->dcmColorModel); + todo_wine ok(!hal->dwDevCaps, "Got device caps %#lx.\n", hal->dwDevCaps); + todo_wine ok(!hal->dtcTransformCaps.dwCaps, "Got transform caps %#lx.\n", hal->dtcTransformCaps.dwCaps); + todo_wine ok(!hal->bClipping, "Got clipping %#x.\n", hal->bClipping); + todo_wine ok(!memcmp(&hal->dlcLightingCaps, &empty_lighting_caps, sizeof(D3DLIGHTINGCAPS)), + "Lighting caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hal->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hal->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hal->dwDeviceRenderBitDepth); + todo_wine ok(!hal->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hal->dwDeviceZBufferBitDepth); + ok(!hal->dwMaxBufferSize, "Got max buffer size %lu.\n", hal->dwMaxBufferSize); + todo_wine ok(!hal->dwMaxVertexCount, "Got max vertex count %lu.\n", hal->dwMaxVertexCount); + todo_wine ok(!hal->dwMinTextureWidth, "Got min texture width %lu.\n", hal->dwMinTextureWidth); + todo_wine ok(!hal->dwMinTextureHeight, "Got min texture height %lu.\n", hal->dwMinTextureHeight); + todo_wine ok(!hal->dwMaxTextureWidth, "Got max texture width %lu.\n", hal->dwMaxTextureWidth); + todo_wine ok(!hal->dwMaxTextureHeight, "Got max texture height %lu.\n", hal->dwMaxTextureHeight); + todo_wine ok(!hal->dwMinStippleWidth, "Got min stipple width %lu.\n", hal->dwMinStippleWidth); + todo_wine ok(!hal->dwMinStippleHeight, "Got min stipple height %lu.\n", hal->dwMinStippleHeight); + todo_wine ok(!hal->dwMaxStippleWidth, "Got max stipple width %lu.\n", hal->dwMaxStippleWidth); + todo_wine ok(!hal->dwMaxStippleHeight, "Got max stipple height %lu.\n", hal->dwMaxStippleHeight); + todo_wine ok(!hal->dwMaxTextureRepeat, "Got max texture repeat %lu.\n", hal->dwMaxTextureRepeat); + todo_wine ok(!hal->dwMaxTextureAspectRatio, "Got max texture aspect ratio %lu.\n", hal->dwMaxTextureAspectRatio); + todo_wine ok(!hal->dwMaxAnisotropy, "Got max anisotropy %lu.\n", hal->dwMaxAnisotropy); + todo_wine ok(!hal->dvGuardBandLeft, "Got left guard band %.8e.\n", hal->dvGuardBandLeft); + todo_wine ok(!hal->dvGuardBandTop, "Got top guard band %.8e.\n", hal->dvGuardBandTop); + todo_wine ok(!hal->dvGuardBandRight, "Got right guard band %.8e.\n", hal->dvGuardBandRight); + todo_wine ok(!hal->dvGuardBandBottom, "Got bottom guard band %.8e.\n", hal->dvGuardBandBottom); + ok(!hal->dvExtentsAdjust, "Got extents adjust %.8e.\n", hal->dvExtentsAdjust); + todo_wine ok(!hal->dwStencilCaps, "Got stencil caps %#lx.\n", hal->dwStencilCaps); + todo_wine ok(!hal->dwFVFCaps, "Got FVF caps %#lx.\n", hal->dwFVFCaps); + todo_wine ok(!hal->dwTextureOpCaps, "Got texture op caps %#lx.\n", hal->dwTextureOpCaps); + todo_wine ok(!hal->wMaxTextureBlendStages, "Got max blend stages %u.\n", hal->wMaxTextureBlendStages); + todo_wine ok(!hal->wMaxSimultaneousTextures, "Got max simultaneous textures %u.\n", hal->wMaxSimultaneousTextures); + } + if(IsEqualGUID(&IID_IDirect3DRGBDevice, guid)) { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING + | D3DDD_LINECAPS + | D3DDD_TRICAPS + | D3DDD_DEVICERENDERBITDEPTH + | D3DDD_DEVICEZBUFFERBITDEPTH + | D3DDD_MAXBUFFERSIZE + | D3DDD_MAXVERTEXCOUNT; + + static const DWORD device_caps = D3DDEVCAPS_FLOATTLVERTEX + | D3DDEVCAPS_EXECUTESYSTEMMEMORY + | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY + | D3DDEVCAPS_TEXTURESYSTEMMEMORY + | D3DDEVCAPS_DRAWPRIMTLVERTEX; + + ok(enum_devices_index == 0, "Expected index %u.\n", enum_devices_index); + todo_wine ok(!strcmp(device_name, "RGB Emulation"), "Got name %s.\n", debugstr_a(device_name)); + + ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(hel->dcmColorModel == D3DCOLOR_RGB, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == device_caps, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n");
- ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, "RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
- ok(hal->dcmColorModel == 0, "RGB Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_RGB, "RGB Device hel caps has colormodel %lu\n", hel->dcmColorModel); - - ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, - "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { + static const DWORD hel_flags = D3DDD_COLORMODEL + | D3DDD_DEVCAPS + | D3DDD_TRANSFORMCAPS + | D3DDD_LIGHTINGCAPS + | D3DDD_BCLIPPING; + + ok(enum_devices_index == 1, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Direct3D HAL"), "Got name %s.\n", debugstr_a(device_name)); + ok(hal->dcmColorModel == D3DCOLOR_RGB, "HAL Device hal caps has colormodel %lu\n", hel->dcmColorModel); - ok(hel->dcmColorModel == 0, "HAL Device hel caps has colormodel %lu\n", hel->dcmColorModel);
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
- ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, - "HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, "HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + + todo_wine ok(hel->dwFlags == hel_flags, "Got HEL flags %#lx.\n", hel->dwFlags); + ok(!hel->dcmColorModel, "Got color model %#lx.\n", hel->dcmColorModel); + todo_wine ok(hel->dwDevCaps == D3DDEVCAPS_FLOATTLVERTEX, "Got device caps %#lx.\n", hel->dwDevCaps); + ok(hel->dtcTransformCaps.dwCaps == D3DTRANSFORMCAPS_CLIP, + "Got transform caps %#lx.\n", hel->dtcTransformCaps.dwCaps); + ok(hel->bClipping == TRUE, "Got clipping %#x.\n", hel->bClipping); + ok(hel->dlcLightingCaps.dwCaps == (D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT + | D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT), + "Got lighting caps %#lx.\n", hel->dlcLightingCaps.dwCaps); + ok(hel->dlcLightingCaps.dwLightingModel == D3DLIGHTINGMODEL_RGB, + "Got lighting model %#lx.\n", hel->dlcLightingCaps.dwLightingModel); + todo_wine ok(!hel->dlcLightingCaps.dwNumLights, + "Got light count %lu.\n", hel->dlcLightingCaps.dwNumLights); + todo_wine ok(!memcmp(&hel->dpcLineCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Line caps didn't match.\n"); + todo_wine ok(!memcmp(&hel->dpcTriCaps, &empty_primitive_caps, sizeof(D3DPRIMCAPS)), "Triangle caps didn't match.\n"); + todo_wine ok(!hel->dwDeviceRenderBitDepth, "Got colour depth %#lx.\n", hel->dwDeviceRenderBitDepth); + todo_wine ok(!hel->dwDeviceZBufferBitDepth, "Got Z depth %#lx.\n", hel->dwDeviceZBufferBitDepth); + ok(!hel->dwMaxBufferSize, "Got max buffer size %lu.\n", hel->dwMaxBufferSize); + ok(hel->dwMaxVertexCount == hal->dwMaxVertexCount, "Got HAL max vertex count %lu, HEL %lu.\n", + hal->dwMaxVertexCount, hel->dwMaxVertexCount); + todo_wine ok(!hel->dwMinTextureWidth, "Got min texture width %lu.\n", hel->dwMinTextureWidth); + todo_wine ok(!hel->dwMinTextureHeight, "Got min texture height %lu.\n", hel->dwMinTextureHeight); + todo_wine ok(!hel->dwMaxTextureWidth, "Got max texture width %lu.\n", hel->dwMaxTextureWidth); + todo_wine ok(!hel->dwMaxTextureHeight, "Got max texture height %lu.\n", hel->dwMaxTextureHeight); + todo_wine ok(!hel->dwMinStippleWidth, "Got min stipple width %lu.\n", hel->dwMinStippleWidth); + todo_wine ok(!hel->dwMinStippleHeight, "Got min stipple height %lu.\n", hel->dwMinStippleHeight); + todo_wine ok(!hel->dwMaxStippleWidth, "Got max stipple width %lu.\n", hel->dwMaxStippleWidth); + todo_wine ok(!hel->dwMaxStippleHeight, "Got max stipple height %lu.\n", hel->dwMaxStippleHeight); + todo_wine ok(!hel->dwMaxTextureRepeat, "Got max texture repeat %lu.\n", hel->dwMaxTextureRepeat); + todo_wine ok(!hel->dwMaxTextureAspectRatio, "Got max texture aspect ratio %lu.\n", hel->dwMaxTextureAspectRatio); + todo_wine ok(!hel->dwMaxAnisotropy, "Got max anisotropy %lu.\n", hel->dwMaxAnisotropy); + todo_wine ok(!hel->dvGuardBandLeft, "Got left guard band %.8e.\n", hel->dvGuardBandLeft); + todo_wine ok(!hel->dvGuardBandTop, "Got top guard band %.8e.\n", hel->dvGuardBandTop); + todo_wine ok(!hel->dvGuardBandRight, "Got right guard band %.8e.\n", hel->dvGuardBandRight); + todo_wine ok(!hel->dvGuardBandBottom, "Got bottom guard band %.8e.\n", hel->dvGuardBandBottom); + ok(!hel->dvExtentsAdjust, "Got extents adjust %.8e.\n", hel->dvExtentsAdjust); + todo_wine ok(!hel->dwStencilCaps, "Got stencil caps %#lx.\n", hel->dwStencilCaps); + todo_wine ok(!hel->dwFVFCaps, "Got FVF caps %#lx.\n", hel->dwFVFCaps); + todo_wine ok(!hel->dwTextureOpCaps, "Got texture op caps %#lx.\n", hel->dwTextureOpCaps); + todo_wine ok(!hel->wMaxTextureBlendStages, "Got max blend stages %u.\n", hel->wMaxTextureBlendStages); + todo_wine ok(!hel->wMaxSimultaneousTextures, "Got max simultaneous textures %u.\n", hel->wMaxSimultaneousTextures); } else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid)) { @@ -19638,77 +19751,6 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); } - else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid)) - { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - - ok(hal->dcmColorModel == 0, "Ramp Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_MONO, "Ramp Device hel caps has colormodel %lu\n", - hel->dcmColorModel); - - ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - } - else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid)) - { - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set\n"); - - ok((hal->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok((hal->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) == 0, - "MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcLineCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE, - "MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n"); - - ok(hal->dcmColorModel == 0, "MMX Device hal caps has colormodel %lu\n", hal->dcmColorModel); - ok(hel->dcmColorModel == D3DCOLOR_RGB, "MMX Device hel caps has colormodel %lu\n", hel->dcmColorModel); - - ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags); - ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags); - - ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, - "MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); - ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, - "MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); - } else { ok(FALSE, "Unexpected device enumerated: "%s" "%s"\n", device_desc, device_name); @@ -19730,6 +19772,7 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d trace("hel tri does NOT have pow2 set\n"); }
+ ++enum_devices_index; return DDENUMRET_OK; }
@@ -19754,7 +19797,7 @@ static void test_enum_devices(void) hr = IDirect3D3_EnumDevices(d3d, NULL, NULL); ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
- hr = IDirect3D3_EnumDevices(d3d, test_enum_devices_caps_callback, NULL); + hr = IDirect3D3_EnumDevices(d3d, test_enum_devices_caps_callback, ddraw); ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
IDirect3D3_Release(d3d); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 84da71aaf4c..2306caba3cc 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -19891,11 +19891,16 @@ static void test_filling_convention(void) DestroyWindow(window); }
+static unsigned int enum_devices_index; + static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *device_name, D3DDEVICEDESC7 *device_desc7, void *ctx) { if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DTnLHalDevice)) { + todo_wine ok(enum_devices_index == 2, "Expected index %u.\n", enum_devices_index); + todo_wine ok(!strcmp(device_name, "Direct3D T&L HAL"), "Got name %s.\n", debugstr_a(device_name)); + ok(device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT, "TnLHal Device device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, @@ -19903,6 +19908,9 @@ static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *d } else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DHALDevice)) { + ok(enum_devices_index == 1, "Expected index %u.\n", enum_devices_index); + ok(!strcmp(device_name, "Direct3D HAL"), "Got name %s.\n", debugstr_a(device_name)); + ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "HAL Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX, @@ -19910,6 +19918,9 @@ static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *d } else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DRGBDevice)) { + todo_wine ok(enum_devices_index == 0, "Expected index %u.\n", enum_devices_index); + todo_wine ok(!strcmp(device_name, "RGB Emulation"), "Got name %s.\n", debugstr_a(device_name)); + ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0, "RGB Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, @@ -19922,6 +19933,7 @@ static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *d ok(FALSE, "Unexpected device enumerated: "%s" "%s"\n", device_desc, device_name); }
+ ++enum_devices_index; return DDENUMRET_OK; }