[PATCH 4/5] d3d/tests: Table fog does not abs the fog coordinate.
Stefan Dösinger
stefan at codeweavers.com
Tue Nov 25 15:34:12 CST 2014
Testing this with non-transformed vertices is pointless because z < 0.0
would be clipped anyway in the ortho_fog case. Otherwise we should use
gl_Position.w (but currently don't), which can't be < 0.0 either.
---
dlls/d3d8/tests/visual.c | 85 +++++++++++++++++++++++++++++++++++++----------
dlls/d3d9/tests/visual.c | 85 +++++++++++++++++++++++++++++++++++++----------
dlls/ddraw/tests/ddraw7.c | 72 ++++++++++++++++++++++++++++++---------
3 files changed, 190 insertions(+), 52 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
index ebc8770..6b2967f 100644
--- a/dlls/d3d8/tests/visual.c
+++ b/dlls/d3d8/tests/visual.c
@@ -5381,34 +5381,69 @@ static void negative_fixedfunction_fog_test(void)
{{ 1.0f, -1.0f, -0.5f}, 0xffff0000},
{{ 1.0f, 1.0f, -0.5f}, 0xffff0000},
};
+ static const struct
+ {
+ struct vec4 position;
+ D3DCOLOR diffuse;
+ }
+ tquad[] =
+ {
+ {{ 0.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{ 0.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ };
union
{
DWORD d;
float f;
} conv;
unsigned int i;
+ static const D3DMATRIX zero =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ }}};
+ /* Needed to make AMD drivers happy. Yeah, it is not supposed to
+ * have an effect on RHW draws. */
+ static const D3DMATRIX identity =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ }}};
static const struct
{
+ DWORD pos_type;
+ const void *quad;
+ size_t stride;
+ const D3DMATRIX *matrix;
float start, end;
- D3DFOGMODE vfog;
- DWORD color;
+ D3DFOGMODE vfog, tfog;
+ DWORD color, color_broken;
}
tests[] =
{
/* fog_interpolation_test 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. */
- { 0.0f, 1.0f, D3DFOG_LINEAR, 0x00808000},
- {-1.0f, 0.0f, D3DFOG_LINEAR, 0x0000ff00},
- { 0.0f, 1.0f, D3DFOG_EXP, 0x009b6400},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, 0.0f, 1.0f,
+ D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, -1.0f, 0.0f,
+ D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, 0.0f, 1.0f,
+ D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400},
+ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, 0.0f, 1.0f,
+ D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000},
+ /* 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},
};
- static const D3DMATRIX proj_mat =
- {{{
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- }}};
+ D3DCAPS8 caps;
window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
@@ -5423,8 +5458,11 @@ static void negative_fixedfunction_fog_test(void)
return;
}
- hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
- ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr);
+ hr = IDirect3DDevice8_GetDeviceCaps(device, &caps);
+ ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
+ if (!(caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE))
+ skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests.\n");
+
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE);
@@ -5433,14 +5471,21 @@ static void negative_fixedfunction_fog_test(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGCOLOR, 0x0000ff00);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
- hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &proj_mat);
- ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, FALSE);
+ ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr);
for (i = 0; i < sizeof(tests) / sizeof(*tests); i++)
{
+ if (!(caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE) && tests[i].tfog)
+ continue;
+
hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0);
ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, tests[i].matrix);
+ ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetVertexShader(device, tests[i].pos_type | D3DFVF_DIFFUSE);
+ ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr);
conv.f = tests[i].start;
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGSTART, conv.d);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
@@ -5449,15 +5494,19 @@ static void negative_fixedfunction_fog_test(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGVERTEXMODE, tests[i].vfog);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGTABLEMODE, tests[i].tfog);
+ ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+
hr = IDirect3DDevice8_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
- hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad));
+ hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, tests[i].quad, tests[i].stride);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice8_EndScene(device);
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = getPixelColor(device, 320, 240);
- ok(color_match(color, tests[i].color, 2), "Got unexpected color 0x%08x, case %u.\n", color, i);
+ ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 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 2a84c1d..c31957f 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -16984,34 +16984,69 @@ static void negative_fixedfunction_fog_test(void)
{{ 1.0f, -1.0f, -0.5f}, 0xffff0000},
{{ 1.0f, 1.0f, -0.5f}, 0xffff0000},
};
+ static const struct
+ {
+ struct vec4 position;
+ D3DCOLOR diffuse;
+ }
+ tquad[] =
+ {
+ {{ 0.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{ 0.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ };
union
{
DWORD d;
float f;
} conv;
unsigned int i;
+ static const D3DMATRIX zero =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ }}};
+ /* Needed to make AMD drivers happy. Yeah, it is not supposed to
+ * have an effect on RHW draws. */
+ static const D3DMATRIX identity =
+ {{{
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ }}};
static const struct
{
+ DWORD pos_type;
+ const void *quad;
+ size_t stride;
+ const D3DMATRIX *matrix;
float start, end;
- D3DFOGMODE vfog;
- DWORD color;
+ D3DFOGMODE vfog, tfog;
+ DWORD color, color_broken;
}
tests[] =
{
/* fog_interpolation_test 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. */
- { 0.0f, 1.0f, D3DFOG_LINEAR, 0x00808000},
- {-1.0f, 0.0f, D3DFOG_LINEAR, 0x0000ff00},
- { 0.0f, 1.0f, D3DFOG_EXP, 0x009b6400},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, 0.0f, 1.0f,
+ D3DFOG_LINEAR, D3DFOG_NONE, 0x00808000, 0x00808000},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, -1.0f, 0.0f,
+ D3DFOG_LINEAR, D3DFOG_NONE, 0x0000ff00, 0x0000ff00},
+ {D3DFVF_XYZ, quad, sizeof(*quad), &zero, 0.0f, 1.0f,
+ D3DFOG_EXP, D3DFOG_NONE, 0x009b6400, 0x009b6400},
+ {D3DFVF_XYZRHW, tquad, sizeof(*tquad), &identity, 0.0f, 1.0f,
+ D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000},
+ /* 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},
};
- static const D3DMATRIX proj_mat =
- {{{
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
- }}};
+ D3DCAPS9 caps;
window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
@@ -17026,8 +17061,11 @@ static void negative_fixedfunction_fog_test(void)
return;
}
- hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE);
- ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
+ ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
+ if (!(caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE))
+ skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests.\n");
+
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE);
@@ -17036,14 +17074,21 @@ static void negative_fixedfunction_fog_test(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0x0000ff00);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
- hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &proj_mat);
- ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, FALSE);
+ ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr);
for (i = 0; i < sizeof(tests) / sizeof(*tests); i++)
{
+ if (!(caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE) && tests[i].tfog)
+ continue;
+
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0);
ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, tests[i].matrix);
+ ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetFVF(device, tests[i].pos_type | D3DFVF_DIFFUSE);
+ ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr);
conv.f = tests[i].start;
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, conv.d);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
@@ -17052,15 +17097,19 @@ static void negative_fixedfunction_fog_test(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, tests[i].vfog);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, tests[i].tfog);
+ ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+
hr = IDirect3DDevice9_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
- hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad));
+ hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, tests[i].quad, tests[i].stride);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice9_EndScene(device);
ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
color = getPixelColor(device, 320, 240);
- ok(color_match(color, tests[i].color, 2), "Got unexpected color 0x%08x, case %u.\n", color, i);
+ ok(color_match(color, tests[i].color, 2) || broken(color_match(color, tests[i].color_broken, 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 8fdddd7..0362ecb 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -8022,34 +8022,61 @@ static void test_negative_fixedfunction_fog(void)
{{ 1.0f, -1.0f, -0.5f}, 0xffff0000},
{{ 1.0f, 1.0f, -0.5f}, 0xffff0000},
};
+ static struct
+ {
+ struct vec4 position;
+ D3DCOLOR diffuse;
+ }
+ tquad[] =
+ {
+ {{ 0.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 0.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{ 0.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ {{640.0f, 480.0f, -0.5f, 1.0f}, 0xffff0000},
+ };
union
{
DWORD d;
float f;
} conv;
unsigned int i;
+ static D3DMATRIX zero =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ };
+ static D3DMATRIX identity =
+ {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f
+ };
static const struct
{
+ DWORD pos_type;
+ void *quad;
+ D3DMATRIX *matrix;
float start, end;
- D3DFOGMODE vfog;
- DWORD color;
+ D3DFOGMODE vfog, tfog;
+ DWORD color, color_broken;
}
tests[] =
{
/* 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. */
- { 0.0f, 1.0f, D3DFOG_LINEAR, 0x00808000},
- {-1.0f, 0.0f, D3DFOG_LINEAR, 0x0000ff00},
- { 0.0f, 1.0f, D3DFOG_EXP, 0x009b6400},
- };
- static D3DMATRIX proj_mat =
- {
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f
+ {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},
+ {D3DFVF_XYZRHW, tquad, &identity, 0.0f, 1.0f, D3DFOG_NONE, D3DFOG_LINEAR, 0x00ff0000, 0x00ff0000},
+ /* 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},
};
+ D3DDEVICEDESC7 caps;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, 0, 0, 0, 0);
@@ -8063,6 +8090,10 @@ static void test_negative_fixedfunction_fog(void)
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_GetCaps(device, &caps);
+ ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
+ if (!(caps.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE))
+ skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests.\n");
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
@@ -8072,14 +8103,19 @@ static void test_negative_fixedfunction_fog(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGCOLOR, 0x0000ff00);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
- hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &proj_mat);
- ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE);
+ ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr);
for (i = 0; i < sizeof(tests) / sizeof(*tests); i++)
{
+ if (!(caps.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_FOGTABLE) && tests[i].tfog)
+ continue;
+
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0);
ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, tests[i].matrix);
+ ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr);
conv.f = tests[i].start;
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGSTART, conv.d);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
@@ -8088,15 +8124,19 @@ static void test_negative_fixedfunction_fog(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, tests[i].vfog);
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+ hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGTABLEMODE, tests[i].tfog);
+ ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
+
hr = IDirect3DDevice7_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP,
- D3DFVF_XYZ | D3DFVF_DIFFUSE, quad, 4, 0);
+ tests[i].pos_type | D3DFVF_DIFFUSE, tests[i].quad, 4, 0);
hr = IDirect3DDevice7_EndScene(device);
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), "Got unexpected color 0x%08x, case %u.\n", color, i);
+ ok(compare_color(color, tests[i].color, 2) || broken(compare_color(color, tests[i].color_broken, 2)),
+ "Got unexpected color 0x%08x, case %u.\n", color, i);
}
IDirectDrawSurface7_Release(rt);
--
2.0.4
More information about the wine-patches
mailing list