4 AttributeSort
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:34:24 -08:00
DirectXMesh

Reorders the faces grouping together all those that use the same attribute id.

This optimizes draw submission by minimizing state changes and maximizing draw batches.

HRESULT AttributeSort(
   size_t nFaces, uint32_t* attributes, uint32_t* faceRemap );

Parameters

The attributes array is sorted by this function, and is used as both an input and an output.

faceRemap indicates the new face ordering: oldLoc = faceRemap[newLoc]. See ReorderIB and ReorderIBAndAdjacency for details.

Remarks

This function does not duplicate any vertices. The ideal attribute sort for vertex pre-transform cache optimization ensures that each vertex is only used once for a given attribute. This can be accomplished by calling Clean before doing this sort.