draw llvm: allow runtime switching of pipelines (yes/no to llvm)
authorZack Rusin <zackr@vmware.com>
Mon, 19 Apr 2010 16:52:25 +0000 (12:52 -0400)
committerZack Rusin <zackr@vmware.com>
Mon, 19 Apr 2010 16:53:27 +0000 (12:53 -0400)
use DRAW_USE_LLVM to disable or enable (default) llvm

src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/draw/draw_pt.c

index e250b3a1d5af299fac5e8a62e3b4bc23232c88f5..2ef05cea37d37ad82d805050ffdac647b81af84c 100644 (file)
@@ -251,6 +251,7 @@ struct draw_context
 
 #ifdef HAVE_LLVM
    LLVMExecutionEngineRef engine;
+   bool use_llvm;
 #endif
    void *driver_private;
 };
index 43f6c5650a0f62969945f6fef0bba59ea16040df..f803e6d86a4e1743c7855e570cd8710c8a67ffff 100644 (file)
@@ -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