Mesa (master): draw llvm: allow runtime switching of pipelines (yes/ no to llvm)

Zack Rusin zack at kemper.freedesktop.org
Mon Apr 19 16:48:35 UTC 2010


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

Author: Zack Rusin <zackr at vmware.com>
Date:   Mon Apr 19 12:52:25 2010 -0400

draw llvm: allow runtime switching of pipelines (yes/no to llvm)

use DRAW_USE_LLVM to disable or enable (default) llvm

---

 src/gallium/auxiliary/draw/draw_private.h |    1 +
 src/gallium/auxiliary/draw/draw_pt.c      |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h
index e250b3a..2ef05ce 100644
--- a/src/gallium/auxiliary/draw/draw_private.h
+++ b/src/gallium/auxiliary/draw/draw_private.h
@@ -251,6 +251,7 @@ struct draw_context
 
 #ifdef HAVE_LLVM
    LLVMExecutionEngineRef engine;
+   bool use_llvm;
 #endif
    void *driver_private;
 };
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index 43f6c56..f803e6d 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -123,6 +123,7 @@ boolean draw_pt_init( struct draw_context *draw )
 {
    draw->pt.test_fse = debug_get_bool_option("DRAW_FSE", FALSE);
    draw->pt.no_fse = debug_get_bool_option("DRAW_NO_FSE", FALSE);
+   draw->use_llvm = debug_get_bool_option("DRAW_USE_LLVM", TRUE);
 
    draw->pt.front.vcache = draw_pt_vcache( draw );
    if (!draw->pt.front.vcache)
@@ -141,7 +142,8 @@ boolean draw_pt_init( struct draw_context *draw )
       return FALSE;
 
 #if HAVE_LLVM
-   draw->pt.middle.general = draw_pt_fetch_pipeline_or_emit_llvm( draw );
+   if (draw->use_llvm)
+      draw->pt.middle.general = draw_pt_fetch_pipeline_or_emit_llvm( draw );
 #else
    draw->pt.middle.general = NULL;
 #endif




More information about the mesa-commit mailing list