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

d3d9: Do not expect consistent failures.

The drivers for some radeon cards are not prepared for the things the fixed function type test does and fail inconsistently. Thus skip the color comparison if one of the two draws fails, and do not write an extra complaint about the inconsistency
parent 27dd3428
......@@ -5588,20 +5588,31 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
{ 90, 300, 0.1, 2.0, 0x00ffff00},
{ 570, 300, 0.1, 2.0, 0x00ffff00}
};
D3DCAPS9 caps;
memset(&caps, 0, sizeof(caps));
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(hr == D3D_OK, "GetDeviceCaps failed, hr = %08x\n", hr);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);
ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_d3dcolor, &dcl_color);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_ubyte4n, &dcl_ubyte);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_short4, &dcl_short);
ok(SUCCEEDED(hr) || hr == E_FAIL, "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_float, &dcl_float);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_ubyte4n_2streams, &dcl_ubyte_2);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
if(caps.DeclTypes & D3DDTCAPS_UBYTE4N) {
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_ubyte4n_2streams, &dcl_ubyte_2);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_ubyte4n, &dcl_ubyte);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
} else {
trace("D3DDTCAPS_UBYTE4N not supported\n");
dcl_ubyte_2 = NULL;
dcl_ubyte = NULL;
}
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_d3dcolor_2streams, &dcl_color_2);
ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (%08x)\n", hr);
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_positiont, &dcl_positiont);
......@@ -5857,7 +5868,10 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
"pixel 572/302 has color %08x, expected 0x000000ff\n", color);
/* This test is pointless without those two declarations: */
if(!dcl_color_2 || !dcl_ubyte_2) goto out;
if((!dcl_color_2) || (!dcl_ubyte_2)) {
skip("color-ubyte switching test declarations aren't supported\n");
goto out;
}
hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quads), (void **) &data, 0);
ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %s\n", DXGetErrorString9(hr));
......@@ -5907,7 +5921,7 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 8, 2);
ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL,
"IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr);
ok(ub_ok == SUCCEEDED(hr), "dcl_ubyte_2 returned two different results\n");
ub_ok = (SUCCEEDED(hr) && ub_ok);
hr = IDirect3DDevice9_EndScene(device);
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %s\n", DXGetErrorString9(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