message: demo: Expand vcachetester with --stat option
  This lets us run the algorithms on a large set of meshes and just get
  the aggregate information.
diff: @@ -327,10 +327,24 @@ void testCacheMeshes(IDXGIAdapter* adapter, int argc, char** argv)
  setupShaders(device, context);
  + bool stat = false;
  +
  + double atvr_sum = 0;
  + double atvr_count = 0;
  +
  + unsigned int total_invocations = 0;
  + unsigned int total_vertices = 0;
  +
  for (int i = 1; i < argc; ++i)
  {
  const char* path = argv[i];
  + if (strcmp(path, "--stat") == 0)
  + {
  + stat = true;
  + continue;
  + }
  +
  ObjFile file;
  if (!objParseFile(file, path))
  @@ -357,6 +371,21 @@ void testCacheMeshes(IDXGIAdapter* adapter, int argc, char** argv)
  unsigned int invocations1 = queryVSInvocations(device, context, ib1.data(), index_count);
  + if (stat)
  + {
  + std::vector<unsigned int> ib2(ib1.size());
  + meshopt::optimizeVertexCache(&ib2[0], &ib1[0], ib1.size(), vertex_count, 0);
  +
  + unsigned int invocations = queryVSInvocations(device, context, ib2.data(), index_count);
  +
  + atvr_sum += double(invocations) / double(vertex_count);
  + atvr_count += 1;
  +
  + total_invocations += invocations;
  + total_vertices += vertex_count;
  + }
  + else
  + {
  printf("%s: baseline %f\n", path, double(invocations1) / double(vertex_count));
  for (unsigned int cache_size = 14; cache_size <= 24; ++cache_size)
  @@ -375,6 +404,12 @@ void testCacheMeshes(IDXGIAdapter* adapter, int argc, char** argv)
  }
  }
  + if (stat)
  + {
  + printf("ATVR: average %f cumulative %f; %d vertices\n", atvr_sum / atvr_count, double(total_invocations) / double(total_vertices), total_vertices);
  + }
  +}
  +
  void modelCacheFIFO(size_t model_cache_size)
  {
  inspectCache([&](const unsigned int* indices, size_t index_count) { return estimateVSInvocationsFIFO(indices, index_count, model_cache_size); });
  