message: overdraw: Optimize rasterizer in Debug
  Instead of using functions for det2x2 and min/max, replace min/max with
  simple macros and manually inline det2x2 function.
  This makes rasterizer ~3x faster in Debug with MSVC 2017.
diff: @@ -18,24 +18,13 @@ struct OverdrawBuffer
  unsigned int overdraw[kViewport][kViewport][2];
  };
  -template <typename T>
  -static T min(T a, T b)
  -{
  - return a < b ? a : b;
  -}
  +#ifndef min
  +#define min(a, b) ((a) < (b) ? (a) : (b))
  +#endif
  -template <typename T>
  -static T max(T a, T b)
  -{
  - return a > b ? a : b;
  -}
  -
  -static float det2x2(float a, float b, float c, float d)
  -{
  - // (a b)
  - // (c d)
  - return a * d - b * c;
  -}
  +#ifndef max
  +#define max(a, b) ((a) > (b) ? (a) : (b))
  +#endif
  static float computeDepthGradients(float& dzdx, float& dzdy, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)
  {
  @@ -44,11 +33,11 @@ static float computeDepthGradients(float& dzdx, float& dzdy, float x1, float y1,
  // (x2-x1 y2-y1)(dzdx) = (z2-z1)
  // (x3-x1 y3-y1)(dzdy) (z3-z1)
  // we'll solve it with Cramer's rule
  - float det = det2x2(x2 - x1, y2 - y1, x3 - x1, y3 - y1);
  + float det = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1);
  float invdet = (det == 0) ? 0 : 1 / det;
  - dzdx = det2x2(z2 - z1, y2 - y1, z3 - z1, y3 - y1) * invdet;
  - dzdy = det2x2(x2 - x1, z2 - z1, x3 - x1, z3 - z1) * invdet;
  + dzdx = (z2 - z1) * (y3 - y1) - (y2 - y1) * (z3 - z1) * invdet;
  + dzdy = (x2 - x1) * (z3 - z1) - (z2 - z1) * (x3 - x1) * invdet;
  return det;
  }
  