summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/llvm/tgsitollvm.cpp
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2008-02-12 23:08:42 -0500
committerZack Rusin <[email protected]>2008-02-12 23:11:05 -0500
commit3c3c1ff5cd19af23033e080d8f0b9b5ae8363f2e (patch)
treede5cfa513de1fd1fd73403fdb2f1cc7c3a13befd /src/mesa/pipe/llvm/tgsitollvm.cpp
parentcad7bc74d69ee053452aa4bd20740dc79ad6eab6 (diff)
stop generate llvm entry points
entrypoints are useless because we use the same paths as all other code. also simplify llvm swizzling code
Diffstat (limited to 'src/mesa/pipe/llvm/tgsitollvm.cpp')
-rw-r--r--src/mesa/pipe/llvm/tgsitollvm.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/pipe/llvm/tgsitollvm.cpp b/src/mesa/pipe/llvm/tgsitollvm.cpp
index bc4df610717..574e340f668 100644
--- a/src/mesa/pipe/llvm/tgsitollvm.cpp
+++ b/src/mesa/pipe/llvm/tgsitollvm.cpp
@@ -178,9 +178,8 @@ swizzleVector(llvm::Value *val, struct tgsi_full_src_register *src,
Storage *storage)
{
int swizzle = swizzleInt(src);
- const int NO_SWIZZLE = TGSI_SWIZZLE_X * 1000 + TGSI_SWIZZLE_Y * 100 +
- TGSI_SWIZZLE_Z * 10 + TGSI_SWIZZLE_W;
- if (swizzle != NO_SWIZZLE) {
+
+ if (gallivm_is_swizzle(swizzle)) {
/*fprintf(stderr, "XXXXXXXX swizzle = %d\n", swizzle);*/
val = storage->shuffleVector(val, swizzle);
}
@@ -1107,12 +1106,11 @@ tgsi_to_llvm(struct gallivm_ir *ir, const struct tgsi_token *tokens)
llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
const struct tgsi_token *tokens)
{
- llvm::Module *mod = createBaseShader();
+ llvm::Module *mod = new Module("shader");
struct tgsi_parse_context parse;
struct tgsi_full_instruction fi;
struct tgsi_full_declaration fd;
unsigned instno = 0;
- Function* shader = mod->getFunction("execute_shader");
std::ostringstream stream;
if (ir->type == GALLIVM_VS) {
stream << "vs_shader";
@@ -1121,7 +1119,9 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
}
stream << ir->id;
std::string func_name = stream.str();
- shader->setName(func_name.c_str());
+ Function *shader = llvm::cast<Function>(mod->getOrInsertFunction(
+ func_name.c_str(),
+ (const llvm::FunctionType*)0));
Function::arg_iterator args = shader->arg_begin();
Value *input = args++;