[PATCH] d3d9: test table fog and exp fog in the shader fog test=0A=

Stefan Doesinger stefan at codeweavers.com
Mon Jan 19 18:56:25 CST 2009


=0A=
---=0A=
 dlls/d3d9/tests/visual.c |   49 =
+++++++++++++++++++++++++++++++++++++++++----=0A=
 1 files changed, 44 insertions(+), 5 deletions(-)=0A=
=0A=
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c=0A=
index ab43f2d..5ae1dbd 100644=0A=
--- a/dlls/d3d9/tests/visual.c=0A=
+++ b/dlls/d3d9/tests/visual.c=0A=
@@ -1317,9 +1317,9 @@ out:=0A=
 /* This test tests fog in combination with shaders.=0A=
  * What's tested: linear fog (vertex and table) with pixel shader=0A=
  *                linear table fog with non foggy vertex shader=0A=
- *                vertex fog with foggy vertex shader=0A=
- * What's not tested: non linear fog with shader=0A=
- *                    table fog with foggy vertex shader=0A=
+ *                vertex fog with foggy vertex shader, non-linear=0A=
+ *                fog with shader, non-linear fog with foggy shader,=0A=
+ *                linear table fog with foggy shader=0A=
  */=0A=
 static void fog_with_shader_test(IDirect3DDevice9 *device)=0A=
 {=0A=
@@ -1420,6 +1420,25 @@ static void fog_with_shader_test(IDirect3DDevice9 =
*device)=0A=
         0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},=0A=
 =0A=
         /* vertex shader and pixel shader */=0A=
+        /* The next 4 tests would read the fog coord output, but it =
isn't available.=0A=
+         * The result is a fully fogged quad, no matter what the Z =
coord is. This is on=0A=
+         * a geforce 7400, 97.52 driver, Windows Vista, but probably =
hardware dependent.=0A=
+         * These tests should be disabled if some other hardware =
behaves differently=0A=
+         */=0A=
+        {1, 1, D3DFOG_NONE, D3DFOG_NONE,=0A=
+        {0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, =
0x0000ff00,=0A=
+        0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}},=0A=
+        {1, 1, D3DFOG_LINEAR, D3DFOG_NONE,=0A=
+        {0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, =
0x0000ff00,=0A=
+        0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}},=0A=
+        {1, 1, D3DFOG_EXP, D3DFOG_NONE,=0A=
+        {0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, =
0x0000ff00,=0A=
+        0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}},=0A=
+        {1, 1, D3DFOG_EXP2, D3DFOG_NONE,=0A=
+        {0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, =
0x0000ff00,=0A=
+        0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00}},=0A=
+=0A=
+        /* These use the Z coordinate with linear table fog */=0A=
         {1, 1, D3DFOG_NONE, D3DFOG_LINEAR,=0A=
         {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
         0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},=0A=
@@ -1429,11 +1448,17 @@ static void =
fog_with_shader_test(IDirect3DDevice9 *device)=0A=
         {1, 1, D3DFOG_EXP2, D3DFOG_LINEAR,=0A=
         {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
         0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},=0A=
-=0A=
         {1, 1, D3DFOG_LINEAR, D3DFOG_LINEAR,=0A=
         {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
         0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},=0A=
 =0A=
+        /* Non-linear table fog without fog coord */=0A=
+        {1, 1, D3DFOG_NONE, D3DFOG_EXP,=0A=
+        {0x00ff0000, 0x00e71800, 0x00d12e00, 0x00bd4200, 0x00ab5400, =
0x009b6400,=0A=
+        0x008d7200, 0x007f8000, 0x00738c00, 0x00689700, 0x005ea100}},=0A=
+        {1, 1, D3DFOG_NONE, D3DFOG_EXP2,=0A=
+        {0x00fd0200, 0x00f50200, 0x00f50a00, 0x00e91600, 0x00d92600, =
0x00c73800,=0A=
+        0x00b24d00, 0x009c6300, 0x00867900, 0x00728d00, 0x005ea100}},=0A=
 =0A=
 #if 0  /* FIXME: these fail on GeForce 8500 */=0A=
         /* foggy vertex shader */=0A=
@@ -1451,7 +1476,9 @@ static void fog_with_shader_test(IDirect3DDevice9 =
*device)=0A=
          0x005fa000, 0x003fc000, 0x001fe000, 0x0000ff00, 0x0000ff00}},=0A=
 #endif=0A=
 =0A=
-        /* foggy vertex shader and pixel shader */=0A=
+        /* foggy vertex shader and pixel shader. First 4 tests with =
vertex fog,=0A=
+         * all using the fixed fog-coord linear fog=0A=
+         */=0A=
         {2, 1, D3DFOG_NONE, D3DFOG_NONE,=0A=
         {0x00ff0000, 0x00fe0100, 0x00de2100, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
          0x005fa000, 0x003fc000, 0x001fe000, 0x0000ff00, 0x0000ff00}},=0A=
@@ -1465,6 +1492,18 @@ static void fog_with_shader_test(IDirect3DDevice9 =
*device)=0A=
         {0x00ff0000, 0x00fe0100, 0x00de2100, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
          0x005fa000, 0x003fc000, 0x001fe000, 0x0000ff00, 0x0000ff00}},=0A=
 =0A=
+        /* These use table fog. Here the shader-provided fog coordinate =
is=0A=
+         * ignored and the z coordinate used instead=0A=
+         */=0A=
+        {2, 1, D3DFOG_NONE, D3DFOG_EXP,=0A=
+        {0x00ff0000, 0x00e71800, 0x00d12e00, 0x00bd4200, 0x00ab5400, =
0x009b6400,=0A=
+        0x008d7200, 0x007f8000, 0x00738c00, 0x00689700, 0x005ea100}},=0A=
+        {2, 1, D3DFOG_NONE, D3DFOG_EXP2,=0A=
+        {0x00fd0200, 0x00f50200, 0x00f50a00, 0x00e91600, 0x00d92600, =
0x00c73800,=0A=
+        0x00b24d00, 0x009c6300, 0x00867900, 0x00728d00, 0x005ea100}},=0A=
+        {2, 1, D3DFOG_NONE, D3DFOG_LINEAR,=0A=
+        {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, =
0x007f8000,=0A=
+        0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}},=0A=
     };=0A=
 =0A=
     /* NOTE: changing these values will not affect the tests with foggy =
vertex shader, as the values are hardcoded in the shader*/=0A=
-- =0A=
1.6.0.6=0A=
=0A=

------=_NextPart_000_004B_01C97A6E.1B960EA0--




More information about the wine-patches mailing list