Commit cfd741c6 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d/tests: Show that the vfog abs is not a property of D3DFOG_LINEAR.

parent c9b10beb
......@@ -5389,6 +5389,7 @@ static void test_negative_fixedfunction_fog(void)
float f;
DWORD d;
} start, end;
D3DFOGMODE vfog;
DWORD color;
}
tests[] =
......@@ -5396,8 +5397,9 @@ static void test_negative_fixedfunction_fog(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 =
{{{
......@@ -5430,8 +5432,6 @@ static void test_negative_fixedfunction_fog(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);
......@@ -5444,6 +5444,8 @@ static void test_negative_fixedfunction_fog(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGEND, tests[i].end.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));
......
......@@ -16992,6 +16992,7 @@ static void test_negative_fixedfunction_fog(void)
float f;
DWORD d;
} start, end;
D3DFOGMODE vfog;
DWORD color;
}
tests[] =
......@@ -16999,8 +17000,9 @@ static void test_negative_fixedfunction_fog(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 =
{{{
......@@ -17033,8 +17035,6 @@ static void test_negative_fixedfunction_fog(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);
......@@ -17047,6 +17047,8 @@ static void test_negative_fixedfunction_fog(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, tests[i].end.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));
......
......@@ -8030,6 +8030,7 @@ static void test_negative_fixedfunction_fog(void)
float f;
DWORD d;
} start, end;
D3DFOGMODE vfog;
DWORD color;
}
tests[] =
......@@ -8037,8 +8038,9 @@ static void test_negative_fixedfunction_fog(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 D3DMATRIX proj_mat =
{
......@@ -8069,8 +8071,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);
......@@ -8083,6 +8083,8 @@ static void test_negative_fixedfunction_fog(void)
ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGEND, tests[i].end.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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment