d3d/tests: Geforce8+ GPUs abs() table fog.

This commit is contained in:
Stefan Dösinger 2015-02-13 10:51:38 +01:00 committed by Alexandre Julliard
parent 91c7a84af5
commit f75d1b0c2f
3 changed files with 47 additions and 27 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);
}