i965/vs: Generalize vertex emission code in preparation for GS.
authorPaul Berry <stereotype441@gmail.com>
Fri, 22 Mar 2013 13:59:52 +0000 (06:59 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 11 Apr 2013 16:25:25 +0000 (09:25 -0700)
commit28fe02ce6e6fa6061cf69af9b292ee6553591473
tree14c6f0ebf5d97a95c8bf99a81a77b585222d2543
parent7214451bdce6d553620d2b9b3f1f89d14b113357
i965/vs: Generalize vertex emission code in preparation for GS.

This patch introduces a new function, vec4_visitor::emit_vertex(),
which contains the code for emitting vertices that will need to be
common between the vertex and geometry shaders.

Geometry shaders will need to use a different message header, and a
different opcode, for their URB writes, so we introduce virtual
functions emit_urb_write_header() and emit_urb_write_opcode() to take
care of the GS-specific behaviours.

Also, since vertex emission happens at the end of the VS, but in the
middle of the GS, we need to be sure to only call
emit_shader_time_end() during VS vertex emission.  We accomplish this
by moving the call to emit_shader_time_end() into the VS
implementation of emit_urb_write_opcode().

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp