diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2007-10-29 08:27:32 -0400 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-10-29 16:14:10 +0000 |
commit | 25b17b213b7ba0d1b93ec37211504ee489944ce8 (patch) | |
tree | 5bc773224011ccc2e06e93f73952ef886e351953 /src/mesa/pipe/draw/draw_vertex_shader.c | |
parent | abe8cd19171def0de000e58b9f71c43adf4c6336 (diff) |
Refactor the LLVM code a bit.
Move the CPU vertex shader execution code to the draw
module, remove traces of LLVM from the state tracker,
abstract execution engine for the purposes of the draw module.
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex_shader.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_vertex_shader.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c index 9dbb317f2a..7fd17292b8 100644 --- a/src/mesa/pipe/draw/draw_vertex_shader.c +++ b/src/mesa/pipe/draw/draw_vertex_shader.c @@ -39,6 +39,7 @@ #include "x86/rtasm/x86sse.h" #include "pipe/tgsi/exec/tgsi_core.h" +#include "pipe/llvm/llvmtgsi.h" #define DBG 0 @@ -187,7 +188,7 @@ void draw_vertex_shader_queue_flush( struct draw_context *draw ) // fprintf(stderr, " q(%d) ", draw->vs.queue_nr ); #ifdef MESA_LLVM - if (draw->vertex_shader->state->llvm_prog) { + if (draw->vertex_shader->llvm_prog) { draw_vertex_shader_queue_flush_llvm(draw); return; } @@ -233,6 +234,13 @@ draw_create_vertex_shader(struct draw_context *draw, tgsi_emit_sse2( sh->tokens, &vs->sse2_program ); } #endif +#ifdef MESA_LLVM + vs->llvm_prog = gallivm_from_tgsi(shader->tokens); + if (!draw->engine) + draw->engine = gallivm_cpu_engine_create(vs->llvm_prog); + else + gallivm_cpu_jit_compile(draw->engine, vs->llvm_prog); +#endif return vs; } |