4 ComputeVertexCacheMissRate
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:34:24 -08:00
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