Skip to content

FinalizeVBAndPointReps

Chuck Walbourn edited this page Jan 21, 2022 · 8 revisions
DirectXMesh

Finishes mesh optimization by reordering vertices and/or adding duplicated vertices for the vertex buffer, and the point representatives.

HRESULT FinalizeVBAndPointReps(
   const void* vbin, size_t stride, size_t nVerts, const uint32_t* prin,
   const uint32_t* dupVerts, _In_ size_t nDupVerts,
   const uint32_t* vertexRemap,
   void* vbout, uint32_t* prout );

HRESULT FinalizeVBAndPointReps(
   void* vb, size_t stride, size_t nVerts, uint32_t* pointRep,
   const uint32_t* vertexRemap );

Parameters

The vbin buffer (or vb for in-place finalize) must be nVerts*stride bytes.

The prin buffer (or the pointRep for in-place finalize) must have nVerts elements.

The vbout buffer must be (nVerts+nDupVerts)*stride bytes.

The prout buffer must have nVerts+nDupVerts entries.

A vertexRemap is an array with nVerts+nDupVerts elements that describes how to reorder the vertices of the original mesh: oldLoc = vertexRemap[newLoc]. See OptimizeVertices. It can be nullptr for an 'identity' remap when just performing duplication.

dupVerts contains nDupVerts elements indicating vertices that need duplicating. Each entry indicates the index of the original vbin vertex buffer to duplicate. The vertexRemap array also indicates reorder information for the duplicated vertices (where oldLoc is greater than nVerts). dupVerts can be nullptr if nDupVerts is 0.

Remark

This version is used to maintain the point reps array after a vertex remap. If the point reps are not needed, use FinalizeVB instead.

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Windows 7 Service Pack 1
  • Xbox One
  • Xbox Series X|S
  • Windows Subsystem for Linux

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v16
  • GCC 9.4, 11.3
  • MinGW 12.2, 13.2
  • CMake 3.20

Related Projects

DirectX Tool Kit for DirectX 11

DirectX Tool Kit for DirectX 12

DirectXTex

DirectXMath

Tools

Test Suite

Content Exporter

DxCapsViewer

See also

DirectX Landing Page

Clone this wiki locally