Use std::vector instead of array.  Pass patch_count instead of generic LoD.