[Mesa-dev] [PATCH 2/7] i965: Turn the INTEL_FORCE_GS env var into a driconf option.

Eric Anholt eric at anholt.net
Tue Mar 6 14:57:13 PST 2012


---
 src/mesa/drivers/dri/i965/brw_context.c   |    1 +
 src/mesa/drivers/dri/i965/brw_context.h   |    3 +++
 src/mesa/drivers/dri/i965/brw_gs.c        |    3 +--
 src/mesa/drivers/dri/intel/intel_screen.c |    6 +++++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 65de260..30db5b4 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -313,6 +313,7 @@ brwCreateContext(int api,
    brw_draw_init( brw );
 
    brw->precompile = driQueryOptionb(&intel->optionCache, "shader_precompile");
+   brw->gs.force_enable = driQueryOptionb(&intel->optionCache, "force_gs");
 
    ctx->Const.NativeIntegers = true;
    ctx->Const.UniformBooleanTrue = 1;
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index a16145b..507720d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -865,6 +865,9 @@ struct brw_context
       struct brw_gs_prog_data *prog_data;
 
       bool prog_active;
+      /** Debug option to always enable a passthrough GS program */
+      bool force_enable;
+
       /** Offset in the program cache to the CLIP program pre-gen6 */
       uint32_t prog_offset;
       uint32_t state_offset;
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index bfca169..cbcd31f 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -234,8 +234,7 @@ static void populate_key( struct brw_context *brw,
    /* For testing, the environment variable INTEL_FORCE_GS can be used to
     * force a GS program to be used, even if it's not necessary.
     */
-   if (getenv("INTEL_FORCE_GS"))
-      key->need_gs_prog = true;
+   key->need_gs_prog = brw->gs.force_enable;
 }
 
 /* Calculate interpolants for triangle and line rasterization.
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 48762d0..39c9fb4 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -83,10 +83,14 @@ PUBLIC const char __driConfigOptions[] =
       DRI_CONF_OPT_BEGIN(shader_precompile, bool, false)
 	 DRI_CONF_DESC(en, "Perform code generation at shader link time.")
       DRI_CONF_OPT_END
+
+      DRI_CONF_OPT_BEGIN(force_gs, bool, false)
+	 DRI_CONF_DESC(en, "Always use a passthrough GS program on gen4/5.")
+      DRI_CONF_OPT_END
    DRI_CONF_SECTION_END
 DRI_CONF_END;
 
-const GLuint __driNConfigOptions = 13;
+const GLuint __driNConfigOptions = 14;
 
 #include "intel_batchbuffer.h"
 #include "intel_buffers.h"
-- 
1.7.9.1



More information about the mesa-dev mailing list