Added support for more than 64K vertices to the generic primitive