From 1c3e725d6363c34837f76d03e40d3cabd69110ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 7 Apr 2008 14:07:22 +0200 Subject: [PATCH] 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 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 879e2c45c69..969f79bbb0e 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;