d3dx9: Return error if D3DXMESH_VB_SHARE and new declaration.
This commit is contained in:
parent
be8dd2e876
commit
8f5543c34e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue