[PATCH 3/5] d3d/tests: Show that the vfog abs is not a property of D3DFOG_LINEAR.
Stefan Dösinger
stefan at codeweavers.com
Tue Nov 25 15:34:11 CST 2014
For EXP2 fog the abs does not make a difference.
---
dlls/d3d8/tests/visual.c | 10 ++++++----
dlls/d3d9/tests/visual.c | 10 ++++++----
dlls/ddraw/tests/ddraw7.c | 10 ++++++----
3 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
index 199b204..ebc8770 100644
--- a/dlls/d3d8/tests/visual.c
+++ b/dlls/d3d8/tests/visual.c
@@ -5390,6 +5390,7 @@ static void negative_fixedfunction_fog_test(void)
static const struct
{
float start, end;
+ D3DFOGMODE vfog;
DWORD color;
}
tests[] =
@@ -5397,8 +5398,9 @@ static void negative_fixedfunction_fog_test(void)
/* 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, 0x00808000},
- {-1.0f, 0.0f, 0x0000ff00},
+ { 0.0f, 1.0f, D3DFOG_LINEAR, 0x00808000},
+ {-1.0f, 0.0f, D3DFOG_LINEAR, 0x0000ff00},
+ { 0.0f, 1.0f, D3DFOG_EXP, 0x009b6400},
};
static const D3DMATRIX proj_mat =
{{{
@@ -5431,8 +5433,6 @@ 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_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR);
- 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);
@@ -5447,6 +5447,8 @@ static void negative_fixedfunction_fog_test(void)
conv.f = tests[i].end;
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGEND, conv.d);
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_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad));
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 714a225..2a84c1d 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -16993,6 +16993,7 @@ static void negative_fixedfunction_fog_test(void)
static const struct
{
float start, end;
+ D3DFOGMODE vfog;
DWORD color;
}
tests[] =
@@ -17000,8 +17001,9 @@ static void negative_fixedfunction_fog_test(void)
/* 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, 0x00808000},
- {-1.0f, 0.0f, 0x0000ff00},
+ { 0.0f, 1.0f, D3DFOG_LINEAR, 0x00808000},
+ {-1.0f, 0.0f, D3DFOG_LINEAR, 0x0000ff00},
+ { 0.0f, 1.0f, D3DFOG_EXP, 0x009b6400},
};
static const D3DMATRIX proj_mat =
{{{
@@ -17034,8 +17036,6 @@ 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_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR);
- 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);
@@ -17050,6 +17050,8 @@ static void negative_fixedfunction_fog_test(void)
conv.f = tests[i].end;
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, conv.d);
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_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad));
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index ce56990..8fdddd7 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -8031,6 +8031,7 @@ static void test_negative_fixedfunction_fog(void)
static const struct
{
float start, end;
+ D3DFOGMODE vfog;
DWORD color;
}
tests[] =
@@ -8038,8 +8039,9 @@ static void test_negative_fixedfunction_fog(void)
/* 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, 0x00808000},
- {-1.0f, 0.0f, 0x0000ff00},
+ { 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 =
{
@@ -8070,8 +8072,6 @@ 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_SetRenderState(device, D3DRENDERSTATE_FOGVERTEXMODE, D3DFOG_LINEAR);
- 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);
@@ -8086,6 +8086,8 @@ static void test_negative_fixedfunction_fog(void)
conv.f = tests[i].end;
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGEND, conv.d);
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_BeginScene(device);
ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP,
--
2.0.4
More information about the wine-patches
mailing list