From 451d85a71c5d128f487cb081a9eddfd5c682ea9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Sun, 27 Jan 2008 14:02:00 +0100 Subject: [PATCH] d3d9: Some drivers allow non-aligned offsets. --- dlls/d3d9/tests/device.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 8ad5d63bf5..bba4eb2562 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1755,34 +1755,38 @@ static void test_set_stream_source(void) hr = IDirect3DDevice9_CreateVertexBuffer( device, 512, 0, 0, D3DPOOL_DEFAULT, &pVertexBuffer, NULL ); ok(hr == D3D_OK, "Failed to create a vertex buffer, hr = %s\n", DXGetErrorString9(hr)); if (SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 0, 32); - ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 1, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 1, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 2, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 2, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 3, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 3, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 4, 32); - ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", - DXGetErrorString9(hr)); + /* Some cards(Geforce 7400 at least) accept non-aligned offsets, others(radeon 9000 verified) reject it, + * so accept both results. Wine currently rejects this to be able to optimize the vbo conversion, but writes + * a WARN + */ + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 0, 32); + ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 1, 32); + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 1, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 2, 32); + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 2, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 3, 32); + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 3, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 4, 32); + ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", + DXGetErrorString9(hr)); } /* Try to set the NULL buffer with an offset and stride 0 */ hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", DXGetErrorString9(hr)); hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 1, 0); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 1, hr = %s\n", + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 1, hr = %s\n", DXGetErrorString9(hr)); hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 2, 0); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 2, hr = %s\n", + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 2, hr = %s\n", DXGetErrorString9(hr)); hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 3, 0); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 3, hr = %s\n", + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Unexpected result when setting the stream source, offset 3, hr = %s\n", DXGetErrorString9(hr)); hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 4, 0); ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", -- 2.32.0.93.g670b81a890