Commit 8f5543c3 authored by Michael Mc Donnell's avatar Michael Mc Donnell Committed by Alexandre Julliard

d3dx9: Return error if D3DXMESH_VB_SHARE and new declaration.

parent be8dd2e8
......@@ -707,7 +707,10 @@ static HRESULT WINAPI ID3DXMeshImpl_CloneMesh(ID3DXMesh *iface, DWORD options, C
same_declaration = declaration_equals(declaration, orig_declaration);
if (options & D3DXMESH_VB_SHARE) {
if (!same_declaration) goto error;
if (!same_declaration) {
hr = D3DERR_INVALIDCALL;
goto error;
}
IDirect3DVertexBuffer9_AddRef(This->vertex_buffer);
/* FIXME: refactor to avoid creating a new vertex buffer */
IDirect3DVertexBuffer9_Release(cloned_this->vertex_buffer);
......
......@@ -9916,9 +9916,9 @@ static void test_clone_mesh(void)
hr = mesh->lpVtbl->CloneMesh(mesh, tc[2].create_options | D3DXMESH_VB_SHARE,
tc[2].new_declaration, test_context->device,
&mesh_clone);
todo_wine ok(hr == D3DERR_INVALIDCALL, "CloneMesh D3DXMESH_VB_SHARE with new"
" declaration. Got %x, expected D3DERR_INVALIDCALL\n",
hr);
ok(hr == D3DERR_INVALIDCALL, "CloneMesh D3DXMESH_VB_SHARE with new"
" declaration. Got %x, expected D3DERR_INVALIDCALL\n",
hr);
mesh->lpVtbl->Release(mesh);
mesh = NULL;
mesh_clone = NULL;
......
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