Commit b2dac1df authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

d3dx9: Implement GetNumBytesPerVertex using the vertex declaration.

If a declaration without a corresponding FVF is used to create the mesh, then its declaration must be used to get the vertex size.
parent 96d5d06f
......@@ -157,10 +157,15 @@ static HRESULT WINAPI ID3DXMeshImpl_GetDeclaration(ID3DXMesh *iface, D3DVERTEXEL
static DWORD WINAPI ID3DXMeshImpl_GetNumBytesPerVertex(ID3DXMesh *iface)
{
ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface);
UINT numelements;
D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE] = { D3DDECL_END() };
TRACE("iface (%p)\n", This);
return D3DXGetFVFVertexSize(This->fvf);
IDirect3DVertexDeclaration9_GetDeclaration(This->vertex_declaration,
declaration,
&numelements);
return D3DXGetDeclVertexSize(declaration, 0);
}
static DWORD WINAPI ID3DXMeshImpl_GetOptions(ID3DXMesh *iface)
......
......@@ -1216,6 +1216,9 @@ static void D3DXCreateMeshTest(void)
free_mesh(&mesh);
}
mesh.vertex_size = d3dxmesh->lpVtbl->GetNumBytesPerVertex(d3dxmesh);
ok(mesh.vertex_size == 60, "Got vertex size %u, expected %u\n", mesh.vertex_size, 60);
d3dxmesh->lpVtbl->Release(d3dxmesh);
}
......
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