Mesa (master): i965/vs: Move the flag for whether to use the new backend to the context.

Eric Anholt anholt at kemper.freedesktop.org
Tue Aug 30 19:10:32 UTC 2011


Module: Mesa
Branch: master
Commit: 2f82c33deefba61b3e72edb4375850c0629af224
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f82c33deefba61b3e72edb4375850c0629af224

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Aug 19 11:42:50 2011 -0700

i965/vs: Move the flag for whether to use the new backend to the context.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_context.c |    2 ++
 src/mesa/drivers/dri/i965/brw_context.h |    1 +
 src/mesa/drivers/dri/i965/brw_vs.c      |    6 +-----
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 898ad8a..6c2e3e4 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -248,6 +248,8 @@ GLboolean brwCreateContext( int api,
 
    brw_draw_init( brw );
 
+   brw->new_vs_backend = (getenv("INTEL_NEW_VS") != NULL);
+
    return GL_TRUE;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index df63fe1..e936a88 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -523,6 +523,7 @@ struct brw_context
    GLboolean has_negative_rhw_bug;
    GLboolean has_aa_line_parameters;
    GLboolean has_pln;
+   GLboolean new_vs_backend;
 
    struct {
       struct brw_state_flags dirty;
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index f3a394b..3fb389a 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -54,7 +54,6 @@ 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));
@@ -90,10 +89,7 @@ do_vs_prog(struct brw_context *brw,
 
    /* Emit GEN4 code.
     */
-   if (new_vs == -1)
-      new_vs = getenv("INTEL_NEW_VS") != NULL;
-
-   if (new_vs && prog) {
+   if (brw->new_vs_backend && prog) {
       if (!brw_vs_emit(prog, &c)) {
 	 ralloc_free(mem_ctx);
 	 return false;




More information about the mesa-commit mailing list