microsoft / DirectXMesh

DirectXMesh geometry processing library

Home Page:https://walbourn.github.io/directxmesh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OptimizeFacesLRU

walbourn opened this issue · comments

A common alternative algorithm to the Hoppe vertex-cache strip order optimization in D3DX is Tom Forsyth's algorithm. This provides more robust 'device independent' support, and is a bit faster by avoiding the need for adjacency information.

Forsyth, T.; "Linear-Speed Vertex Cache Optimisation". September 2006 Link

HRESULT OptimizeFacesLRU(
   _In_reads_(nFaces*3) const uint16_t* indices, _In_ size_t nFaces,
   _In_ size_t nVerts,
   _Out_writes_(nFaces) uint32_t* faceRemap,
   _In_ uint32_t vertexCache = OPTFACES_V_DEFAULT );

HRESULT OptimizeFacesLRU(
   _In_reads_(nFaces*3) const uint32_t* indices, _In_ size_t nFaces,
   _In_ size_t nVerts,
   _Out_writes_(nFaces) uint32_t* faceRemap,
   _In_ uint32_t vertexCache = OPTFACES_V_DEFAULT );    

An implementation of LRU is in the MiniEngine cpp / h