Skip to content

ComputeVertexCacheMissRate

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

Returns the average cache miss ratio (ACMR) and average triangle vertex resuse (ATVR) for the post-transform vertex cache.

void ComputeVertexCacheMissRate(
   const uint16_t* indices, size_t nFaces, size_t nVerts,
   size_t cacheSize, float& acmr, float& atvr );

void ComputeVertexCacheMissRate(
   const uint32_t* indices, size_t nFaces, size_t nVerts,
   size_t cacheSize, float& acmr, float& atvr );

Parameters

Pass OPTFACES_V_DEFAULT as the vertexCache to evaluate the 'device independent' optimization for OptimizeFaces.

The resulting acmr and atvr are returned as out parameters. They are set to -1.f if there was an error with the input values.

Example

uint16_t g_fmCubeIndices16[ 12*3 ] =
{
   3,1,0,
   2,1,3,

   6,4,5,
   7,4,6,

   11,9,8,
   10,9,11,

   14,12,13,
   15,12,14,

   19,17,16,
   18,17,19,

   22,20,21,
   23,20,22
};

float acmr, atvr;
ComputeVertexCacheMissRate( cubeIndices, 12, 24, OPTFACES_V_DEFAULT, acmr, atvr );

// acmr is 2.f, atvr is 1.f

Further reading

ACMR and ATVR

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