Commit 544fd16c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw/tests: Try to avoid killing the Intel (kernel) driver.

parent 05f9b023
......@@ -81,6 +81,60 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa
&& compare_float(vec->w, w, ulps);
}
static BOOL ddraw_is_warp(IDirectDraw *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return !!strstr(identifier.szDriver, "warp");
}
static BOOL ddraw_is_nvidia(IDirectDraw *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x10de;
}
static BOOL ddraw_is_intel(IDirectDraw *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x8086;
}
static IDirectDrawSurface *create_overlay(IDirectDraw *ddraw,
unsigned int width, unsigned int height, DWORD format)
{
......@@ -4208,6 +4262,15 @@ static void test_flip(void)
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
{
/* Creating a flippable texture induces a BSoD on some versions of the
* Intel graphics driver. At least Intel GMA 950 with driver version
* 6.14.10.4926 on Windows XP SP3 is affected. */
if ((test_data[i].caps & DDSCAPS_TEXTURE) && ddraw_is_intel(ddraw))
{
win_skip("Skipping flippable texture test.\n");
continue;
}
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
......@@ -5329,23 +5392,6 @@ static void test_palette_complex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_warp(IDirectDraw *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return !!strstr(identifier.szDriver, "warp");
}
static void test_p8_blit(void)
{
IDirectDrawSurface *src, *dst, *dst_p8;
......@@ -7626,23 +7672,6 @@ done:
DestroyWindow(window);
}
static BOOL ddraw_is_nvidia(IDirectDraw *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x10de;
}
static void test_colorkey_precision(void)
{
static D3DTLVERTEX quad[] =
......
......@@ -83,6 +83,60 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa
&& compare_float(vec->w, w, ulps);
}
static BOOL ddraw_is_warp(IDirectDraw2 *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return !!strstr(identifier.szDriver, "warp");
}
static BOOL ddraw_is_nvidia(IDirectDraw2 *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x10de;
}
static BOOL ddraw_is_intel(IDirectDraw2 *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x8086;
}
static IDirectDrawSurface *create_overlay(IDirectDraw2 *ddraw,
unsigned int width, unsigned int height, DWORD format)
{
......@@ -4838,6 +4892,15 @@ static void test_flip(void)
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
{
/* Creating a flippable texture induces a BSoD on some versions of the
* Intel graphics driver. At least Intel GMA 950 with driver version
* 6.14.10.4926 on Windows XP SP3 is affected. */
if ((test_data[i].caps & DDSCAPS_TEXTURE) && ddraw_is_intel(ddraw))
{
win_skip("Skipping flippable texture test.\n");
continue;
}
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
......@@ -6386,23 +6449,6 @@ static void test_palette_complex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_warp(IDirectDraw2 *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return !!strstr(identifier.szDriver, "warp");
}
static void test_p8_blit(void)
{
IDirectDrawSurface *src, *dst, *dst_p8;
......@@ -8785,23 +8831,6 @@ done:
DestroyWindow(window);
}
static BOOL ddraw_is_nvidia(IDirectDraw2 *ddraw)
{
IDirectDraw4 *ddraw4;
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirectDraw4, (void **)&ddraw4);
ok(SUCCEEDED(hr), "Failed to get IDirectDraw4 interface, hr %#x.\n", hr);
hr = IDirectDraw4_GetDeviceIdentifier(ddraw4, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
IDirectDraw4_Release(ddraw4);
return identifier.dwVendorId == 0x10de;
}
static void test_colorkey_precision(void)
{
static D3DLVERTEX quad[] =
......
......@@ -92,6 +92,48 @@ static BOOL compare_color(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff)
return TRUE;
}
static BOOL ddraw_is_warp(IDirectDraw4 *ddraw)
{
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return !!strstr(identifier.szDriver, "warp");
}
static BOOL ddraw_is_nvidia(IDirectDraw4 *ddraw)
{
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x10de;
}
static BOOL ddraw_is_intel(IDirectDraw4 *ddraw)
{
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x8086;
}
static IDirectDrawSurface4 *create_overlay(IDirectDraw4 *ddraw,
unsigned int width, unsigned int height, DWORD format)
{
......@@ -6128,6 +6170,15 @@ static void test_flip(void)
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
{
/* Creating a flippable texture induces a BSoD on some versions of the
* Intel graphics driver. At least Intel GMA 950 with driver version
* 6.14.10.4926 on Windows XP SP3 is affected. */
if ((test_data[i].caps & DDSCAPS_TEXTURE) && ddraw_is_intel(ddraw))
{
win_skip("Skipping flippable texture test.\n");
continue;
}
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
......@@ -7883,19 +7934,6 @@ static void test_palette_complex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_warp(IDirectDraw4 *ddraw)
{
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return !!strstr(identifier.szDriver, "warp");
}
static void test_p8_blit(void)
{
IDirectDrawSurface4 *src, *dst, *dst_p8;
......@@ -9890,19 +9928,6 @@ static void test_texcoordindex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_nvidia(IDirectDraw4 *ddraw)
{
DDDEVICEIDENTIFIER identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw4_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x10de;
}
static void test_colorkey_precision(void)
{
static struct
......
......@@ -102,6 +102,48 @@ static ULONG get_refcount(IUnknown *iface)
return IUnknown_Release(iface);
}
static BOOL ddraw_is_warp(IDirectDraw7 *ddraw)
{
DDDEVICEIDENTIFIER2 identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return !!strstr(identifier.szDriver, "warp");
}
static BOOL ddraw_is_nvidia(IDirectDraw7 *ddraw)
{
DDDEVICEIDENTIFIER2 identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x10de;
}
static BOOL ddraw_is_intel(IDirectDraw7 *ddraw)
{
DDDEVICEIDENTIFIER2 identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x8086;
}
static IDirectDrawSurface7 *create_overlay(IDirectDraw7 *ddraw,
unsigned int width, unsigned int height, DWORD format)
{
......@@ -5994,6 +6036,15 @@ static void test_flip(void)
for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i)
{
/* Creating a flippable texture induces a BSoD on some versions of the
* Intel graphics driver. At least Intel GMA 950 with driver version
* 6.14.10.4926 on Windows XP SP3 is affected. */
if ((test_data[i].caps & DDSCAPS_TEXTURE) && ddraw_is_intel(ddraw))
{
win_skip("Skipping flippable texture test.\n");
continue;
}
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS;
......@@ -7791,19 +7842,6 @@ static void test_palette_complex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_warp(IDirectDraw7 *ddraw)
{
DDDEVICEIDENTIFIER2 identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return !!strstr(identifier.szDriver, "warp");
}
static void test_p8_blit(void)
{
IDirectDrawSurface7 *src, *dst, *dst_p8;
......@@ -10221,19 +10259,6 @@ static void test_texcoordindex(void)
DestroyWindow(window);
}
static BOOL ddraw_is_nvidia(IDirectDraw7 *ddraw)
{
DDDEVICEIDENTIFIER2 identifier;
HRESULT hr;
if (!strcmp(winetest_platform, "wine"))
return FALSE;
hr = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
ok(SUCCEEDED(hr), "Failed to get device identifier, hr %#x.\n", hr);
return identifier.dwVendorId == 0x10de;
}
static void test_colorkey_precision(void)
{
static struct
......
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