summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/llvm/tgsitollvm.cpp
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2008-02-13 04:38:10 -0500
committerZack Rusin <zack@tungstengraphics.com>2008-02-13 04:38:10 -0500
commit4bb1a14d901fcddb25efeeff49c4dea8ca872f73 (patch)
tree9abc2e5fe642b06374d6690035174918ebd12b06 /src/mesa/pipe/llvm/tgsitollvm.cpp
parente179d5bdd199e3747773f5b07efcf9a635c41089 (diff)
handle temporaries in llvm code generated paths
Diffstat (limited to 'src/mesa/pipe/llvm/tgsitollvm.cpp')
-rw-r--r--src/mesa/pipe/llvm/tgsitollvm.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/mesa/pipe/llvm/tgsitollvm.cpp b/src/mesa/pipe/llvm/tgsitollvm.cpp
index 070c9a67f3..3497eebcd9 100644
--- a/src/mesa/pipe/llvm/tgsitollvm.cpp
+++ b/src/mesa/pipe/llvm/tgsitollvm.cpp
@@ -53,23 +53,23 @@ static inline FunctionType *vertexShaderFunctionType()
// pass are castable to the following:
// [4 x <4 x float>] inputs,
// [4 x <4 x float>] output,
- // [4 x [4 x float]] consts
+ // [4 x [4 x float]] consts,
+ // [4 x <4 x float>] temps
+
std::vector<const Type*> funcArgs;
- {
- VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
- ArrayType *vectorArray = ArrayType::get(vectorType, 4);
- PointerType *vectorArrayPtr = PointerType::get(vectorArray, 0);
+ VectorType *vectorType = VectorType::get(Type::FloatTy, 4);
+ ArrayType *vectorArray = ArrayType::get(vectorType, 4);
+ PointerType *vectorArrayPtr = PointerType::get(vectorArray, 0);
- funcArgs.push_back(vectorArrayPtr);//inputs
- funcArgs.push_back(vectorArrayPtr);//output
- }
- {
- ArrayType *floatArray = ArrayType::get(Type::FloatTy, 4);
- ArrayType *constsArray = ArrayType::get(floatArray, 4);
- PointerType *constsArrayPtr = PointerType::get(constsArray, 0);
+ ArrayType *floatArray = ArrayType::get(Type::FloatTy, 4);
+ ArrayType *constsArray = ArrayType::get(floatArray, 4);
+ PointerType *constsArrayPtr = PointerType::get(constsArray, 0);
+
+ funcArgs.push_back(vectorArrayPtr);//inputs
+ funcArgs.push_back(vectorArrayPtr);//output
+ funcArgs.push_back(constsArrayPtr);//consts
+ funcArgs.push_back(vectorArrayPtr);//temps
- funcArgs.push_back(constsArrayPtr);//consts
- }
FunctionType *functionType = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/funcArgs,
@@ -1162,6 +1162,8 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
output->setName("outputs");
Value *consts = args++;
consts->setName("consts");
+ Value *temps = args++;
+ temps->setName("temps");
BasicBlock *label_entry = new BasicBlock("entry", shader, 0);
@@ -1170,7 +1172,7 @@ llvm::Module * tgsi_to_llvmir(struct gallivm_ir *ir,
fi = tgsi_default_full_instruction();
fd = tgsi_default_full_declaration();
- StorageSoa storage(label_entry, input, output, consts);
+ StorageSoa storage(label_entry, input, output, consts, temps);
InstructionsSoa instr(mod, shader, label_entry, &storage);
while(!tgsi_parse_end_of_tokens(&parse)) {