summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-05-02 09:45:40 -0700
committerEric Anholt <eric@anholt.net>2011-08-16 13:04:41 -0700
commitaf3c9803d818fd33139f1247a387d64b967b8992 (patch)
tree45f6e1b4be0a9296a14a887cb4de3af0ff636e6c /src/mesa/drivers/dri/i965/brw_vs.c
parent65b5cbbcf783f6c668ab5b31a0734680dd396794 (diff)
downloadexternal_mesa3d-af3c9803d818fd33139f1247a387d64b967b8992.zip
external_mesa3d-af3c9803d818fd33139f1247a387d64b967b8992.tar.gz
external_mesa3d-af3c9803d818fd33139f1247a387d64b967b8992.tar.bz2
i965: Start adding the VS visitor and codegen.
The low-level IR is a mashup of brw_fs.cpp and ir_to_mesa.cpp. It's currently controlled by the INTEL_NEW_VS=1 environment variable, and only tested for the trivial "gl_Position = gl_Vertex;" shader so far.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index a9ad531..bd0677d 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -30,6 +30,7 @@
*/
+#include "main/compiler.h"
#include "brw_context.h"
#include "brw_vs.h"
#include "brw_util.h"
@@ -50,6 +51,7 @@ static void do_vs_prog( struct brw_context *brw,
void *mem_ctx;
int aux_size;
int i;
+ static int new_vs = -1;
memset(&c, 0, sizeof(c));
memcpy(&c.key, key, sizeof(*key));
@@ -85,7 +87,15 @@ static void do_vs_prog( struct brw_context *brw,
/* Emit GEN4 code.
*/
- brw_vs_emit(&c);
+ if (new_vs == -1)
+ new_vs = getenv("INTEL_NEW_VS") != NULL;
+
+ if (new_vs) {
+ if (!brw_vs_emit(&c))
+ brw_old_vs_emit(&c);
+ } else {
+ brw_old_vs_emit(&c);
+ }
/* get the program
*/