OSDN Git Service

i965/vs: Replace brw_vs_emit.c with dumping code into the vec4_visitor.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 8 Oct 2012 17:21:30 +0000 (10:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Nov 2012 21:29:23 +0000 (14:29 -0700)
commit66c8473e028d416a87783da45de34454e4e9f6b8
tree10aae29f37f150098507eafd4a66a06425cf127c
parent1f0093720de41ca23c408f11784fcc39d58271d2
i965/vs: Replace brw_vs_emit.c with dumping code into the vec4_visitor.

Rather than having two separate backends, just create a small layer that
translates the subset of Mesa IR used for ARB_vertex_program and fixed
function programs to the Vec4 IR.  This allows us to use the same
optimization passes, code generator, register allocator as for GLSL.

v2: Incorporate Eric's review comments.
- Fix use of uninitialized src_swiz[] values in the SWIZZLE_ZERO/ONE
  case: just initialize it to 0 (.x) since the value doesn't matter
  (those channels get writemasked out anyway).
- Properly reswizzle source register's swizzles, rather than overwriting
  the swizzle.
- Port the old brw_vs_emit code for computing .x of the EXP2 opcode.
- Update comments, removing mention of NV_vertex_program, etc.
- Delete remaining #warning lines and debug comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_vp.cpp [new file with mode: 0644]
src/mesa/drivers/dri/i965/brw_vs.c