function sortIndicesIfNecessary(indices, sortFunction, vertexCount) {
  arrayScratch.length = indices.length;

  let needsSort = false;
  for (let i = 0, len = indices.length; i < len; ++i) {
    arrayScratch[i] = indices[i];
    needsSort =
      needsSort || (i > 0 && sortFunction(indices[i - 1], indices[i]) > 0);
  }

  if (needsSort) {
    arrayScratch.sort(sortFunction);
    return IndexDatatype.createTypedArray(vertexCount, arrayScratch);
  }
  return indices;
}
The water mask included in this terrain data, if any.  A water mask is a rectangular
Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
@memberof QuantizedMeshTerrainData.prototype
@type {Uint8Array|HTMLImageElement|HTMLCanvasElement|undefined}