From 5ffdada717466a78b5b148764ba23c7a95098887 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 15 Oct 2007 09:59:19 -0400 Subject: Execution engine is a singleton, for now keep it in the pipe. --- src/mesa/pipe/llvm/llvmtgsi.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/mesa/pipe/llvm/llvmtgsi.cpp') diff --git a/src/mesa/pipe/llvm/llvmtgsi.cpp b/src/mesa/pipe/llvm/llvmtgsi.cpp index 1abc148521..a616355f8f 100644 --- a/src/mesa/pipe/llvm/llvmtgsi.cpp +++ b/src/mesa/pipe/llvm/llvmtgsi.cpp @@ -1,5 +1,6 @@ #include "llvmtgsi.h" +#include "pipe/p_context.h" #include "pipe/tgsi/exec/tgsi_exec.h" #include "pipe/tgsi/exec/tgsi_token.h" #include "pipe/tgsi/exec/tgsi_build.h" @@ -469,7 +470,7 @@ tgsi_to_llvm(const struct tgsi_token *tokens) } struct ga_llvm_prog * -ga_llvm_from_tgsi(const struct tgsi_token *tokens) +ga_llvm_from_tgsi(struct pipe_context *pipe, const struct tgsi_token *tokens) { std::cout << "Creating llvm " <llvm_execution_engine) { + ee = llvm::ExecutionEngine::create(mp, false); + pipe->llvm_execution_engine = ee; + } else { + ee = (llvm::ExecutionEngine*)pipe->llvm_execution_engine; + ee->addModuleProvider(mp); + } ga_llvm->module = mod; - ga_llvm->engine = ee; fprintf(stderr, "DUMPX \n"); //tgsi_dump(tokens, TGSI_DUMP_VERBOSE); tgsi_dump(tokens, 0); fprintf(stderr, "DUMPEND \n"); Function *func = mod->getFunction("run_vertex_shader"); - std::cout << "run_vertex_shader = "<function; + std::cout << " -- FUNC is " <function<(prog->function); + runner(inputs, dests, consts, count, num_attribs); std::cout << "---- END LLVM Execution "<