i965: Change type of brw_context.primitive from GLenum to hardware primitive
authorChad Versace <chad@chad-versace.us>
Mon, 26 Sep 2011 23:23:26 +0000 (16:23 -0700)
committerChad Versace <chad@chad-versace.us>
Mon, 10 Oct 2011 20:24:11 +0000 (13:24 -0700)
commitf378e8fea0e6bfda2018ee14a99757bde329e0a7
treef802d813b9a9ca3d7481b1b0617731a04aac4994
parent9559ca600dde0877fe0abd04dd789bd5a3cdfbde
i965: Change type of brw_context.primitive from GLenum to hardware primitive

For example, GL_TRIANLGES is converted to _3DPRIM_TRILIST.

The conversion is necessary because HiZ and MSAA resolve operations emit
a 3DPRIM_RECTLIST, which cannot be conveyed by GLenum.

As a consequence, brw_gs_prog_key.primitive is also converted.

v2
----
- [anholt] Split brw_set_prim into brw/gen6 variants in previous commit,
  since not much code is really shared between the two.
- [anholt] Replace switch statements with table lookups, since this is
  a hot path.

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_gs.h