draw llvm: actually set the constant buffers on the context
authorZack Rusin <zackr@vmware.com>
Tue, 30 Mar 2010 21:21:11 +0000 (17:21 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 30 Mar 2010 21:21:11 +0000 (17:21 -0400)
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c

index cd183d5087c25baa11935a703a37ec60bfe85c3b..1127d5417e8d494bcfc3408c56056f0ce89708a1 100644 (file)
@@ -110,7 +110,7 @@ init_globals(struct draw_llvm *llvm)
       LP_CHECK_STRUCT_SIZE(struct draw_jit_context,
                            llvm->target, context_type);
 
-      LLVMAddTypeName(llvm->module, "context", context_type);
+      LLVMAddTypeName(llvm->module, "draw_jit_context", context_type);
 
       llvm->context_ptr_type = LLVMPointerType(context_type, 0);
    }
index 38b1c4462dbc37d5c6462c96c28a3cf1d4d9b80f..f93df37d92b9cc66fbbd6b1bc73eea5e115e2c47 100644 (file)
@@ -130,6 +130,12 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
    *max_vertices = *max_vertices & ~1;
 
    draw_llvm_prepare(fpme->llvm);
+
+   /*XXX we only support one constant buffer */
+   fpme->llvm->jit_context.vs_constants =
+      draw->pt.user.vs_constants[0];
+   fpme->llvm->jit_context.gs_constants =
+      draw->pt.user.gs_constants[0];
 }
 
 
@@ -241,7 +247,7 @@ static void llvm_middle_end_linear_run( struct draw_pt_middle_end *middle,
 
    fpme->llvm->jit_func( &fpme->llvm->jit_context,
                          pipeline_verts,
-                         draw->pt.user.vbuffer,
+                         (const char **)draw->pt.user.vbuffer,
                          start,
                          count,
                          fpme->vertex_size );