use just one constructor to figure out whether to use llvm.
#include "draw_vs.h"
#include "draw_gs.h"
+#if HAVE_LLVM
+#include "gallivm/lp_bld_init.h"
+#endif
struct draw_context *draw_create( struct pipe_context *pipe )
{
if (draw == NULL)
goto fail;
+#if HAVE_LLVM
+ assert(lp_build_engine);
+ draw->engine = lp_build_engine;
+#endif
+
if (!draw_init(draw))
goto fail;
const struct pipe_rasterizer_state *rasterizer,
unsigned prim );
-#ifdef HAVE_LLVM
-/*******************************************************************************
- * LLVM integration
- */
-struct draw_context *draw_create_with_llvm(void);
-#endif
-
#endif /* DRAW_CONTEXT_H */
init_globals(llvm);
-#if 1
+#if 0
LLVMDumpModule(llvm->module);
#endif
return variant;
}
-
-struct draw_context *draw_create_with_llvm(void)
-{
- struct draw_context *draw = CALLOC_STRUCT( draw_context );
- if (draw == NULL)
- goto fail;
-
- assert(lp_build_engine);
- draw->engine = lp_build_engine;
-
- if (!draw_init(draw))
- goto fail;
-
- return draw;
-
-fail:
- draw_destroy( draw );
- return NULL;
-}
-
static void
generate_vs(struct draw_llvm *llvm,
LLVMBuilderRef builder,
#include "lp_query.h"
#include "lp_setup.h"
-
-#define USE_DRAW_LLVM 1
-
-
static void llvmpipe_destroy( struct pipe_context *pipe )
{
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
/*
* Create drawing context and plug our rendering stage into it.
*/
-#if USE_DRAW_LLVM
- llvmpipe->draw = draw_create_with_llvm(&llvmpipe->pipe);
-#else
llvmpipe->draw = draw_create(&llvmpipe->pipe);
-#endif
if (!llvmpipe->draw)
goto fail;