From f75d1b0c2f77d8c85f7c2a9bcc3545f14e271a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 13 Feb 2015 10:51:38 +0100 Subject: [PATCH] d3d/tests: Geforce8+ GPUs abs() table fog. --- dlls/d3d8/tests/visual.c | 23 ++++++++++++++--------- dlls/d3d9/tests/visual.c | 23 ++++++++++++++--------- dlls/ddraw/tests/ddraw7.c | 28 +++++++++++++++++++--------- 3 files changed, 47 insertions(+), 27 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 40bbc5901c8..c0954633c86 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -5458,26 +5458,30 @@ static void test_negative_fixedfunction_fog(void) DWORD d; } start, end; D3DFOGMODE vfog, tfog; - DWORD color, color_broken; + DWORD color, color_broken, color_broken2; } tests[] = { - /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. */ + /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. + * + * Geforce8+ GPUs on Windows abs() table fog, everything else does not. */ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, { 0.0f}, {1.0f}, - D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000}, + D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00808000, 0x00808000}, /* r200 GPUs and presumably all d3d8 and older HW clamp the fog * parameters to 0.0 and 1.0 in the table fog case. */ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, {-1.0f}, {0.0f}, - D3DFOG_NONE, D3DFOG_LINEAR, 0x00808000, 0x00ff0000}, + D3DFOG_NONE, D3DFOG_LINEAR, 0x00808000, 0x00ff0000, 0x0000ff00}, /* test_fog_interpolation shows that vertex fog evaluates the fog * equation in the vertex pipeline. Start = -1.0 && end = 0.0 shows - * that the abs happens before the fog equation is evaluated. */ + * that the abs happens before the fog equation is evaluated. + * + * Vertex fog abs() behavior is the same on all GPUs. */ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, { 0.0f}, {1.0f}, - D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000}, + D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000, 0x00808000}, {D3DFVF_XYZ, quad, sizeof(*quad), &zero, {-1.0f}, {0.0f}, - D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00}, + D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00, 0x0000ff00}, {D3DFVF_XYZ, quad, sizeof(*quad), &zero, { 0.0f}, {1.0f}, - D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400}, + D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400, 0x009b6400}, }; D3DCAPS8 caps; @@ -5539,7 +5543,8 @@ static void test_negative_fixedfunction_fog(void) ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); - ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 2)), + ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 2)) + || broken(color_match(color, tests[i].color_broken2, 2)), "Got unexpected color 0x%08x, case %u.\n", color, i); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index b4df9c4b414..a8cf55feeb9 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -17057,26 +17057,30 @@ static void test_negative_fixedfunction_fog(void) DWORD d; } start, end; D3DFOGMODE vfog, tfog; - DWORD color, color_broken; + DWORD color, color_broken, color_broken2; } tests[] = { - /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. */ + /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. + * + * Geforce8+ GPUs on Windows abs() table fog, everything else does not. */ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, { 0.0f}, {1.0f}, - D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000}, + D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00808000, 0x00808000}, /* r200 GPUs and presumably all d3d8 and older HW clamp the fog * parameters to 0.0 and 1.0 in the table fog case. */ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, {-1.0f}, {0.0f}, - D3DFOG_NONE, D3DFOG_LINEAR, 0x00808000, 0x00ff0000}, + D3DFOG_NONE, D3DFOG_LINEAR, 0x00808000, 0x00ff0000, 0x0000ff00}, /* test_fog_interpolation shows that vertex fog evaluates the fog * equation in the vertex pipeline. Start = -1.0 && end = 0.0 shows - * that the abs happens before the fog equation is evaluated. */ + * that the abs happens before the fog equation is evaluated. + * + * Vertex fog abs() behavior is the same on all GPUs. */ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, { 0.0f}, {1.0f}, - D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000}, + D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000, 0x00808000}, {D3DFVF_XYZ, quad, sizeof(*quad), &zero, {-1.0f}, {0.0f}, - D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00}, + D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00, 0x0000ff00}, {D3DFVF_XYZ, quad, sizeof(*quad), &zero, { 0.0f}, {1.0f}, - D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400}, + D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400, 0x009b6400}, }; D3DCAPS9 caps; @@ -17138,7 +17142,8 @@ static void test_negative_fixedfunction_fog(void) ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); - ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 2)), + ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 2)) + || broken(color_match(color, tests[i].color_broken2, 2)), "Got unexpected color 0x%08x, case %u.\n", color, i); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 01d0fcb5469..90ea739c571 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8097,21 +8097,30 @@ static void test_negative_fixedfunction_fog(void) DWORD d; } start, end; D3DFOGMODE vfog, tfog; - DWORD color, color_broken; + DWORD color, color_broken, color_broken2; } tests[] = { - /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. */ - {D3DFVF_XYZRHW, tquad, &identity, { 0.0f}, {1.0f}, D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000}, + /* Run the XYZRHW tests first. Depth clamping is broken after RHW draws on the testbot. + * + * Geforce8+ GPUs on Windows abs() table fog, everything else does not. */ + {D3DFVF_XYZRHW, tquad, &identity, { 0.0f}, {1.0f}, D3DFOG_NONE, D3DFOG_LINEAR, + 0x00ff0000, 0x00808000, 0x00808000}, /* r200 GPUs and presumably all d3d8 and older HW clamp the fog * parameters to 0.0 and 1.0 in the table fog case. */ - {D3DFVF_XYZRHW, tquad, &identity, {-1.0f}, {0.0f}, D3DFOG_NONE, D3DFOG_LINEAR, 0x00808000, 0x00ff0000}, + {D3DFVF_XYZRHW, tquad, &identity, {-1.0f}, {0.0f}, D3DFOG_NONE, D3DFOG_LINEAR, + 0x00808000, 0x00ff0000, 0x0000ff00}, /* test_fog_interpolation shows that vertex fog evaluates the fog * equation in the vertex pipeline. Start = -1.0 && end = 0.0 shows - * that the abs happens before the fog equation is evaluated. */ - {D3DFVF_XYZ, quad, &zero, { 0.0f}, {1.0f}, D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000}, - {D3DFVF_XYZ, quad, &zero, {-1.0f}, {0.0f}, D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00}, - {D3DFVF_XYZ, quad, &zero, { 0.0f}, {1.0f}, D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400}, + * that the abs happens before the fog equation is evaluated. + * + * Vertex fog abs() behavior is the same on all GPUs. */ + {D3DFVF_XYZ, quad, &zero, { 0.0f}, {1.0f}, D3DFOG_LINEAR, D3DFOG_NONE, + 0x00808000, 0x00808000, 0x00808000}, + {D3DFVF_XYZ, quad, &zero, {-1.0f}, {0.0f}, D3DFOG_LINEAR, D3DFOG_NONE, + 0x0000ff00, 0x0000ff00, 0x0000ff00}, + {D3DFVF_XYZ, quad, &zero, { 0.0f}, {1.0f}, D3DFOG_EXP, D3DFOG_NONE, + 0x009b6400, 0x009b6400, 0x009b6400}, }; D3DDEVICEDESC7 caps; @@ -8170,7 +8179,8 @@ static void test_negative_fixedfunction_fog(void) ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = get_surface_color(rt, 0, 240); - ok(compare_color(color, tests[i].color, 2) || broken(compare_color(color, tests[i].color_broken, 2)), + ok(compare_color(color, tests[i].color, 2) || broken(compare_color(color, tests[i].color_broken, 2)) + || broken(compare_color(color, tests[i].color_broken2, 2)), "Got unexpected color 0x%08x, case %u.\n", color, i); }