D3DXOptimizeVertices

Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by D3DXOptimizeFaces.

HRESULT D3DXOptimizeVertices(
  LPCVOID pIndices,
  UINT NumFaces,
  UINT NumVertices,
  BOOL Indices32Bit,
  DWORD * pVertexRemap
);

Parameters

pIndices
[in] Pointer to triangle list indices to use for ordering vertices.
NumFaces
[in] Number of faces in the triangle list.
NumVertices
[in] Number of vertices referenced by the triangle list.
Indices32Bit
[in] Flag indicating index type: TRUE if indices are 32-bit (more than 65535 vertices), FALSE if indices are 16-bit (65535 or fewer vertices).
pVertexRemap
[in, out] Pointer to a destination buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering.

Return Values

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Requirements

Header: Declared in D3dx9mesh.h.