From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d9/tests/visual.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 2c83965f0cb..f82bb1e921c 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -19782,7 +19782,9 @@ static void add_dirty_rect_test(void) ok(hr == S_OK, "Failed to set texture, hr %#lx.\n", hr); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); - ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + /* Radeon GPUs read zero from sysmem textures. */ + ok(color_match(color, 0x000000ff, 1) || broken(color_match(color, 0x00000000, 1)), + "Got unexpected color 0x%08x.\n", color);
/* Tests with managed textures. */ fill_surface(surface_managed0, 0x00ff0000, 0);
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d9/tests/visual.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f82bb1e921c..23e22c2340f 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -285,15 +285,18 @@ static D3DCOLOR check_expected_rt_color(unsigned int line, IDirect3DSurface9 *rt return color; }
-#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false) -#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true) -#define check_rt_color_todo_if(a, b, c) check_rt_color_(__LINE__, a, b, c) -static void check_rt_color_(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR expected_color, bool todo) +#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false, 0, false) +#define check_rt_color_broken(a, b, c, d) check_rt_color_(__LINE__, a, b, false, c, d) +#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true, 0, false) +#define check_rt_color_todo_if(a, b, c) check_rt_color_(__LINE__, a, b, c, 0, false) +static void check_rt_color_(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR expected_color, bool todo, + D3DCOLOR broken_color, bool is_broken) { unsigned int color = check_expected_rt_color(line, rt, expected_color);
todo_wine_if (todo) - ok_(__FILE__, line)(color == expected_color, "Got unexpected color 0x%08x.\n", color); + ok_(__FILE__, line)(color == expected_color || broken(is_broken && color == broken_color), + "Got unexpected color 0x%08x.\n", color); }
static IDirect3DDevice9 *create_device(IDirect3D9 *d3d, HWND device_window, HWND focus_window, BOOL windowed) @@ -28012,7 +28015,8 @@ static void test_mipmap_upload(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
draw_textured_quad(&context, texture); - check_rt_color(context.backbuffer, 0x00111111 * (j + 1)); + /* AMD Windows drivers don't sample from sysmem textures. */ + check_rt_color_broken(context.backbuffer, 0x00111111 * (j + 1), 0x00000000, pools[i] == D3DPOOL_SYSTEMMEM);
winetest_pop_context(); }
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d8/tests/visual.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 5c2b71fc8c5..75afff65a9c 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -5828,7 +5828,9 @@ static void add_dirty_rect_test(void) ok(hr == S_OK, "Failed to set texture, hr %#lx.\n", hr); add_dirty_rect_test_draw(device); color = getPixelColor(device, 320, 240); - ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + /* Radeon GPUs read zero from sysmem textures. */ + ok(color_match(color, 0x000000ff, 1) || broken(color_match(color, 0x00000000, 1)), + "Got unexpected color 0x%08x.\n", color);
/* Blitting to the sysmem texture adds a dirty rect. */ fill_surface(surface_src_red, 0x00000000, D3DLOCK_NO_DIRTY_UPDATE);
From: Stefan Dösinger stefan@codeweavers.com
--- dlls/d3d8/tests/visual.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 75afff65a9c..264a4230a75 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -248,10 +248,12 @@ static void check_rect(struct surface_readback *rb, RECT r, const char *message) } }
-#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false) -#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true) -#define check_rt_color_todo_if(a, b, c) check_rt_color_(__LINE__, a, b, c) -static void check_rt_color_(unsigned int line, IDirect3DSurface8 *rt, D3DCOLOR expected_color, bool todo) +#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false, 0, false) +#define check_rt_color_broken(a, b, c, d) check_rt_color_(__LINE__, a, b, false, c, d) +#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true, 0, false) +#define check_rt_color_todo_if(a, b, c) check_rt_color_(__LINE__, a, b, c, 0, false) +static void check_rt_color_(unsigned int line, IDirect3DSurface8 *rt, D3DCOLOR expected_color, bool todo, + D3DCOLOR broken_color, bool is_broken) { unsigned int color = 0xdeadbeef; struct surface_readback rb; @@ -276,7 +278,8 @@ static void check_rt_color_(unsigned int line, IDirect3DSurface8 *rt, D3DCOLOR e } release_surface_readback(&rb); todo_wine_if (todo) - ok_(__FILE__, line)(color == expected_color, "Got unexpected color 0x%08x.\n", color); + ok_(__FILE__, line)(color == expected_color || broken(is_broken && color == broken_color), + "Got unexpected color 0x%08x.\n", color); }
static IDirect3DDevice8 *create_device(IDirect3D8 *d3d, HWND device_window, HWND focus_window, BOOL windowed) @@ -12189,7 +12192,8 @@ static void test_mipmap_upload(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
draw_textured_quad(&context, texture); - check_rt_color(context.backbuffer, 0x00111111 * (j + 1)); + /* AMD Windows drivers don't sample from sysmem textures. */ + check_rt_color_broken(context.backbuffer, 0x00111111 * (j + 1), 0x00000000, pools[i] == D3DPOOL_SYSTEMMEM);
winetest_pop_context(); }
We could honestly just remove the sysmem tests from test_mipmap_upload(). The relevant application uses a managed texture.
This merge request was approved by Zebediah Figura.