From 4c8456264ca9c826165c41810b20dfbfbfb322e3 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 13 Feb 2008 00:48:08 -0500 Subject: [PATCH] get mov working --- src/mesa/pipe/llvm/gallivm.cpp | 3 +++ src/mesa/pipe/llvm/gallivm_cpu.cpp | 4 ++-- src/mesa/pipe/llvm/storagesoa.cpp | 12 ++++++------ src/mesa/pipe/llvm/tgsitollvm.cpp | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/mesa/pipe/llvm/gallivm.cpp b/src/mesa/pipe/llvm/gallivm.cpp index ab13be09151..da0105c2c98 100644 --- a/src/mesa/pipe/llvm/gallivm.cpp +++ b/src/mesa/pipe/llvm/gallivm.cpp @@ -318,6 +318,9 @@ struct gallivm_prog * gallivm_ir_compile(struct gallivm_ir *ir) passes.run(*mod); prog->module = mod; + std::cout << "After optimizations:"<dump(); + return prog; } diff --git a/src/mesa/pipe/llvm/gallivm_cpu.cpp b/src/mesa/pipe/llvm/gallivm_cpu.cpp index 5f1268bf4f8..011cba55c23 100644 --- a/src/mesa/pipe/llvm/gallivm_cpu.cpp +++ b/src/mesa/pipe/llvm/gallivm_cpu.cpp @@ -105,10 +105,10 @@ static inline llvm::Function *func_for_shader(struct gallivm_prog *prog) switch (prog->type) { case GALLIVM_VS: - func = mod->getFunction("run_vertex_shader"); + func = mod->getFunction("vs_shader"); break; case GALLIVM_FS: - func = mod->getFunction("run_fragment_shader"); + func = mod->getFunction("fs_shader"); break; default: assert(!"Unknown shader type!"); diff --git a/src/mesa/pipe/llvm/storagesoa.cpp b/src/mesa/pipe/llvm/storagesoa.cpp index 786511204a3..ef14e29bfed 100644 --- a/src/mesa/pipe/llvm/storagesoa.cpp +++ b/src/mesa/pipe/llvm/storagesoa.cpp @@ -68,9 +68,9 @@ std::vector StorageSoa::inputElement(int idx, int swizzle, std::vector res(4); res[0] = element(m_input, idx, 0); - res[1] = element(m_input, idx, 0); - res[2] = element(m_input, idx, 0); - res[3] = element(m_input, idx, 0); + res[1] = element(m_input, idx, 1); + res[2] = element(m_input, idx, 2); + res[3] = element(m_input, idx, 3); return res; } @@ -89,9 +89,9 @@ std::vector StorageSoa::outputElement(int idx, int swizzle, std::vector res(4); res[0] = element(m_output, idx, 0); - res[1] = element(m_output, idx, 0); - res[2] = element(m_output, idx, 0); - res[3] = element(m_output, idx, 0); + res[1] = element(m_output, idx, 1); + res[2] = element(m_output, idx, 2); + res[3] = element(m_output, idx, 3); return res; } diff --git a/src/mesa/pipe/llvm/tgsitollvm.cpp b/src/mesa/pipe/llvm/tgsitollvm.cpp index d4e9a21a139..070c9a67f3c 100644 --- a/src/mesa/pipe/llvm/tgsitollvm.cpp +++ b/src/mesa/pipe/llvm/tgsitollvm.cpp @@ -1149,7 +1149,7 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir, } else { stream << "fs_shader"; } - stream << ir->id; + //stream << ir->id; std::string func_name = stream.str(); Function *shader = llvm::cast(mod->getOrInsertFunction( func_name.c_str(), -- 2.30.2