#include "gallivm/lp_bld_flow.h"
#include "gallivm/lp_bld_debug.h"
#include "gallivm/lp_bld_tgsi.h"
+#include "gallivm/lp_bld_printf.h"
#include "util/u_cpu_detect.h"
NULL/*sampler*/);
}
+
+static void print_vectorf(LLVMBuilderRef builder,
+ LLVMValueRef vec)
+{
+ LLVMValueRef val[4];
+ val[0] = LLVMBuildExtractElement(builder, vec,
+ LLVMConstInt(LLVMInt32Type(), 0, 0), "");
+ val[1] = LLVMBuildExtractElement(builder, vec,
+ LLVMConstInt(LLVMInt32Type(), 1, 0), "");
+ val[2] = LLVMBuildExtractElement(builder, vec,
+ LLVMConstInt(LLVMInt32Type(), 2, 0), "");
+ val[3] = LLVMBuildExtractElement(builder, vec,
+ LLVMConstInt(LLVMInt32Type(), 3, 0), "");
+ lp_build_printf(builder, "vector = [%f, %f, %f, %f]\n",
+ val[0], val[1], val[2], val[3]);
+}
+
static void
generate_fetch(LLVMBuilderRef builder,
LLVMValueRef vbuffers_ptr,
LLVMConstInt(LLVMInt32Type(), vbuf->stride, 0),
index, "");
+ vbuffer_ptr = LLVMBuildLoad(builder, vbuffer_ptr, "vbuffer");
+
stride = LLVMBuildAdd(builder, stride,
LLVMConstInt(LLVMInt32Type(), vbuf->buffer_offset, 0),
"");
LLVMConstInt(LLVMInt32Type(), velem->src_offset, 0),
"");
+ /*lp_build_printf(builder, "vbuf index = %d, stride is %d\n", indices, stride);*/
vbuffer_ptr = LLVMBuildGEP(builder, vbuffer_ptr, &stride, 1, "");
*res = draw_llvm_translate_from(builder, vbuffer_ptr, velem->src_format);
end = lp_build_add(&bld, start, count);
step = LLVMConstInt(LLVMInt32Type(), max_vertices, 0);
+
lp_build_loop_begin(builder, start, &lp_loop);
{
LLVMValueRef inputs[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
velem->vertex_buffer_index];
generate_fetch(builder, vbuffers_ptr,
&aos_attribs[j][i], velem, vbuf, true_index);
+ /*print_vectorf(builder, aos_attribs[j][i]);*/
}
}
convert_to_soa(builder, aos_attribs, inputs,
ptr_aos,
context_ptr,
io);
- LLVMDumpModule(llvm->module);
}
lp_build_loop_end(builder, end, step, &lp_loop);
LLVMDumpValue(function);
debug_printf("\n");
}
-
llvm->jit_func = (draw_jit_vert_func)LLVMGetPointerToGlobal(llvm->draw->engine, function);
if (1)
#include "gallivm/lp_bld_flow.h"
#include "gallivm/lp_bld_debug.h"
#include "gallivm/lp_bld_tgsi.h"
+#include "gallivm/lp_bld_printf.h"
#include "util/u_memory.h"
#include "pipe/p_state.h"
for (i = 0; i < nr_components; ++i) {
LLVMValueRef src_index = LLVMConstInt(LLVMInt32Type(), offset, 0);
LLVMValueRef dst_index = LLVMConstInt(LLVMInt32Type(), i, 0);
- LLVMValueRef src_tmp = LLVMBuildGEP(builder, ptr, &src_index, 1, "");
+ LLVMValueRef src_tmp;
LLVMValueRef component;
- src_tmp = LLVMBuildLoad(builder, src_tmp, "");
+ src_tmp = LLVMBuildGEP(builder, ptr, &src_index, 1, "src_tmp");
/* convert src_tmp to float */
component = func(builder, src_tmp);