nir: Add a function to count the number of vertices a GS emits.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 25 Sep 2015 00:01:23 +0000 (17:01 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 26 Sep 2015 19:01:53 +0000 (12:01 -0700)
commit02530c5dc5dc88078f41fb134c7e0e3833c9f772
treeb83732ce6a5af75c5a2912f1fcb0296381189333
parentdf221f65e26199a74bc259d3f94e70637b843afa
nir: Add a function to count the number of vertices a GS emits.

Some hardware (such as Broadwell) can run geometry shaders more
efficiently when the number of vertices emitted is statically known.

This pass provides a way to obtain the constant vertex count, or
-1 indicating that the vertex count is unknown/non-constant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/Makefile.sources
src/glsl/nir/nir.h
src/glsl/nir/nir_gs_count_vertices.c [new file with mode: 0644]