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

d3d9: Some Windows drivers do not like reversed fog.

The fog test used start = 0.9 and end = 0.1. This is perfectly ok in theory, but some Windows drivers do not like it. Since this test tests how fog is calculated with Vertex and Pixel shaders put the fog range in the normal order(start = 0.1, end = 0.9), this fixes a number of fog failures on ATI cards on Windows.
parent 1a906aac
...@@ -1156,51 +1156,54 @@ static void fog_with_shader_test(IDirect3DDevice9 *device) ...@@ -1156,51 +1156,54 @@ static void fog_with_shader_test(IDirect3DDevice9 *device)
} test_data[] = { } test_data[] = {
/* only pixel shader: */ /* only pixel shader: */
{0, 1, 0, 3, {0, 1, 0, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{0, 1, 1, 3, {0, 1, 1, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{0, 1, 2, 3, {0, 1, 2, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{0, 1, 3, 0, {0, 1, 3, 0,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{0, 1, 3, 3, {0, 1, 3, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
/* vertex shader */ /* vertex shader */
{1, 0, 0, 0, {1, 0, 0, 0,
{0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, {0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00,
0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}}, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}},
{1, 0, 0, 3, {1, 0, 0, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 0, 1, 3, {1, 0, 1, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 0, 2, 3, {1, 0, 2, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 0, 3, 3, {1, 0, 3, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
/* vertex shader and pixel shader */ /* vertex shader and pixel shader */
{1, 1, 0, 3, {1, 1, 0, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 1, 1, 3, {1, 1, 1, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 1, 2, 3, {1, 1, 2, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
{1, 1, 3, 3, {1, 1, 3, 3,
{0x0000ff00, 0x0000ff00, 0x0020df00, 0x0040bf00, 0x005fa000, 0x007f8000, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000,
0x009f6000, 0x00bf4000, 0x00df2000, 0x00ff0000, 0x00ff0000}}, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},
#if 0 /* FIXME: these fail on GeForce 8500 */ #if 0 /* FIXME: these fail on GeForce 8500 */
/* foggy vertex shader */ /* foggy vertex shader */
...@@ -1235,8 +1238,8 @@ static void fog_with_shader_test(IDirect3DDevice9 *device) ...@@ -1235,8 +1238,8 @@ static void fog_with_shader_test(IDirect3DDevice9 *device)
}; };
/* NOTE: changing these values will not affect the tests with foggy vertex shader, as the values are hardcoded in the shader*/ /* NOTE: changing these values will not affect the tests with foggy vertex shader, as the values are hardcoded in the shader*/
start.f=0.9f; start.f=0.1f;
end.f=0.1f; end.f=0.9f;
hr = IDirect3DDevice9_CreateVertexShader(device, vertex_shader_code1, &vertex_shader[1]); hr = IDirect3DDevice9_CreateVertexShader(device, vertex_shader_code1, &vertex_shader[1]);
ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr); ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr);
......
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