This project has moved and is read-only. For the latest updates, please go here.
Returns the average cache miss ratio (ACMR) and average triangle vertex resuse (ATVR) for the post-transform vertex cache.

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

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

Parameters

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

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

http://www.realtimerendering.com/blog/acmr-and-atvr/

Last edited Jun 26, 2014 at 10:45 PM by walbourn, version 3