nir: Add a function to count the number of vertices a GS emits.