Skip to content

ComputeSubsets

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

Returns a list of face offsets and counts based on the input attributes id array.

std::vector<std::pair<size_t,size_t>> ComputeSubsets(
    const uint32_t* attributes, size_t nFaces );

Return values

The result is a std::vector of value pairs (as a std::pair<size_t,size_t>) where each first value is the offset in the faces array for the start of the attribute subset, and second is the number of faces in that attribute subset.

Remark

For a sorted attribute array, it returns a minimum length list of subsets which covers all faces.

Example

uint32_t cubeAttributes[ 12 ] = { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 5, 5 };

auto subsets = ComputeSubsets( cubeAttributes, 12 );

// subsets contains 5 pairs: <0, 2>, <2, 2>, <4, 2>, <6, 4>, <10, 2>

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

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v18
  • GCC 10.5, 11.4, 12.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