Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/d3d9/tests/visual.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f4aa45f91fa..89f9e9cf2c6 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26911,7 +26911,15 @@ static void test_sample_mask(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); get_rt_readback(rt, &rb); colour = get_readback_color(&rb, 64, 64); - ok(color_match(colour, 0xffff8080, 1), "Got unexpected colour %08x.\n", colour); + /* Multiple generations of Nvidia cards return broken results. + * A mask with no bits or all bits set produce the expected results (0x00 / 0xff), + * but any other mask behaves almost as if the result is 0.5 + (enabled / total) + * samples. It's not quite that though (you'd expect 0xbf or 0xc0 instead of 0xbc). + * + * I looked at a few other possible problems: Incorrectly enabled Z test, alpha test, + * culling, the multisample mask affecting CopyRects. Neither of these make a difference. */ + ok(color_match(colour, 0xffff8080, 1) || broken(color_match(colour, 0xffffbcbc, 1)), + "Got unexpected colour %08x.\n", colour); release_surface_readback(&rb);
hr = IDirect3DDevice9_EndScene(device);
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/d3d8/tests/visual.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 3c61426e17f..8d5f9d39df8 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -11171,7 +11171,15 @@ static void test_sample_mask(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); get_rt_readback(rt, &rb); colour = get_readback_color(&rb, 64, 64); - ok(color_match(colour, 0xffff8080, 1), "Got unexpected colour %08x.\n", colour); + /* Multiple generations of Nvidia cards return broken results. + * A mask with no bits or all bits set produce the expected results (0x00 / 0xff), + * but any other mask behaves almost as if the result is 0.5 + (enabled / total) + * samples. It's not quite that though (you'd expect 0xbf or 0xc0 instead of 0xbc). + * + * I looked at a few other possible problems: Incorrectly enabled Z test, alpha test, + * culling, the multisample mask affecting CopyRects. Neither of these make a difference. */ + ok(color_match(colour, 0xffff8080, 1) || broken(color_match(colour, 0xffffbcbc, 1)), + "Got unexpected colour %08x.\n", colour); release_surface_readback(&rb);
hr = IDirect3DDevice8_EndScene(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/d3d8/tests/visual.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 8d5f9d39df8..de86b7bc07d 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -459,15 +459,22 @@ static void lighting_test(void) const D3DMATRIX *world_matrix; const void *quad; unsigned int size; - DWORD expected; + DWORD expected, broken; const char *message; } tests[] = { - {&mat, nquad, sizeof(nquad[0]), 0x000000ff, "Lit quad with light"}, - {&mat_singular, nquad, sizeof(nquad[0]), 0x000000ff, "Lit quad with singular world matrix"}, - {&mat_transf, rotatedquad, sizeof(rotatedquad[0]), 0x000000ff, "Lit quad with transformation matrix"}, - {&mat_nonaffine, translatedquad, sizeof(translatedquad[0]), 0x00000000, "Lit quad with non-affine matrix"}, + {&mat, nquad, sizeof(nquad[0]), 0x000000ff, 0xdeadbeef, + "Lit quad with light"}, + /* Starting around Win10 20H? this test returns 0x00000000, but only + * in d3d8. In ddraw and d3d9 it works like in older windows versions. + * The behavior is GPU independent. */ + {&mat_singular, nquad, sizeof(nquad[0]), 0x000000ff, 0x00000000, + "Lit quad with singular world matrix"}, + {&mat_transf, rotatedquad, sizeof(rotatedquad[0]), 0x000000ff, 0xdeadbeef, + "Lit quad with transformation matrix"}, + {&mat_nonaffine, translatedquad, sizeof(translatedquad[0]), 0x00000000, 0xdeadbeef, + "Lit quad with non-affine matrix"}, };
window = create_window(); @@ -569,7 +576,8 @@ static void lighting_test(void) ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = getPixelColor(device, 320, 240); - ok(color == tests[i].expected, "%s has color 0x%08x.\n", tests[i].message, color); + ok(color == tests[i].expected || broken(color == tests[i].broken), + "%s has color 0x%08x.\n", tests[i].message, color); }
refcount = IDirect3DDevice8_Release(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com