i965/gen7: Make primitives_written counting work.
i965/gen7: Make primitives_written counting work.

The code was relying on gs.prog_data's copy of the
number-of-verts-per-prim, which segfaulted on gen7 since it doesn't
make a GS program.  We can easily calculate that value right here.

v2: Fix svbi_0_starting_index regression.

Reviewed-by: Paul Berry <de21b9f22e6dd0bdf7890875d6e07ef4967c44ce@gmail.com>
Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>

zz85/glsl-optimizer,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,dellis1972/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer