summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_vertex_shader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex_shader.c')
-rw-r--r--src/mesa/pipe/draw/draw_vertex_shader.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c
index 5ca93aa615..9c31df1e3e 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader.c
+++ b/src/mesa/pipe/draw/draw_vertex_shader.c
@@ -113,7 +113,15 @@ run_vertex_program(struct draw_context *draw,
draw->vertex_fetch.fetch_func( draw, machine, elts, count );
/* run shader */
-#if defined(__i386__) || defined(__386__)
+#ifdef MESA_LLVM
+ if (1) {
+ struct gallivm_prog *prog = draw->vertex_shader->llvm_prog;
+ gallivm_cpu_vs_exec(prog,
+ machine->Inputs,
+ machine->Outputs,
+ machine->Consts);
+ } else
+#elif defined(__i386__) || defined(__386__)
if (draw->use_sse) {
/* SSE */
/* cast away const */
@@ -212,13 +220,7 @@ draw_vertex_shader_queue_flush(struct draw_context *draw)
*/
draw_update_vertex_fetch( draw );
-// debug_printf( " q(%d) ", draw->vs.queue_nr );
-#ifdef MESA_LLVM
- if (draw->vertex_shader->llvm_prog) {
- draw_vertex_shader_queue_flush_llvm(draw);
- return;
- }
-#endif
+// fprintf(stderr, " q(%d) ", draw->vs.queue_nr );
/* run vertex shader on vertex cache entries, four per invokation */
for (i = 0; i < draw->vs.queue_nr; i += 4) {
@@ -260,7 +262,13 @@ draw_create_vertex_shader(struct draw_context *draw,
vs->state = shader;
#ifdef MESA_LLVM
- vs->llvm_prog = gallivm_from_tgsi(shader->tokens, GALLIVM_VS);
+ struct gallivm_ir *ir = gallivm_ir_new(GALLIVM_VS);
+ gallivm_ir_set_layout(ir, GALLIVM_SOA);
+ gallivm_ir_set_components(ir, 4);
+ gallivm_ir_fill_from_tgsi(ir, shader->tokens);
+ vs->llvm_prog = gallivm_ir_compile(ir);
+ gallivm_ir_delete(ir);
+
draw->engine = gallivm_global_cpu_engine();
if (!draw->engine) {
draw->engine = gallivm_cpu_engine_create(vs->llvm_prog);
@@ -296,7 +304,7 @@ draw_bind_vertex_shader(struct draw_context *draw,
draw->vertex_shader = dvs;
draw->num_vs_outputs = dvs->state->num_outputs;
- /* specify the fragment program to interpret/execute */
+ /* specify the vertex program to interpret/execute */
tgsi_exec_machine_init(&draw->machine,
draw->vertex_shader->state->tokens,
PIPE_MAX_SAMPLERS,