Stefan Dösinger : d3d9: Accept erros in the fvp->3. 0 pixel shader varying test.

Alexandre Julliard julliard at winehq.org
Wed Apr 9 05:31:40 CDT 2008


Module: wine
Branch: master
Commit: 1c3e725d6363c34837f76d03e40d3cabd69110ba
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1c3e725d6363c34837f76d03e40d3cabd69110ba

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Apr  7 14:07:22 2008 +0200

d3d9: Accept erros in the fvp->3.0 pixel shader varying test.

Some cards/drivers like ATI and the Geforce 8 driver return an error in
this case, make the test accept that. This lifts some constraints we
have to care for in WineD3D and removes one of the requirement for the
packing shader. We still need the packing shader for vs_1_1 -> ps_3_0
mapping and for indirect pixel shader varying addressing though.

---

 dlls/d3d9/tests/visual.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 879e2c4..969f79b 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -5181,6 +5181,7 @@ static void fixed_function_varying_test(IDirect3DDevice9 *device) {
     HRESULT hr;
     unsigned int i;
     DWORD color, r, g, b, r_e, g_e, b_e;
+    BOOL drawok;
 
     memcpy(data2, data, sizeof(data2));
     data2[0].pos_x = 0;     data2[0].pos_y = 0;
@@ -5212,16 +5213,25 @@ static void fixed_function_varying_test(IDirect3DDevice9 *device) {
 
         hr = IDirect3DDevice9_BeginScene(device);
         ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %s\n", DXGetErrorString9(hr));
+        drawok = FALSE;
         if(SUCCEEDED(hr))
         {
             hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, data, sizeof(data[0]));
-            ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
+            ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "DrawPrimitiveUP failed (%08x)\n", hr);
+            drawok = SUCCEEDED(hr);
             hr = IDirect3DDevice9_EndScene(device);
             ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %s\n", DXGetErrorString9(hr));
         }
         hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
         ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %s\n", DXGetErrorString9(hr));
 
+        /* Some drivers reject the combination of ps_3_0 and fixed function vertex processing. Accept
+         * the failure and do not check the color if it failed
+         */
+        if(!drawok) {
+            continue;
+        }
+
         color = getPixelColor(device, 360, 240);
         r = color & 0x00ff0000 >> 16;
         g = color & 0x0000ff00 >>  8;




More information about the wine-cvs mailing list