From b0f3b5910ebd0737600ab7b1fdc135d74f2617f4 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 29 Oct 2007 10:59:24 -0400 Subject: Enable immediates in TGSI and work with them in LLVM code. Enables immediates by default in the TGSI translation code and adds code handling it in llvm tgsi translation. --- src/mesa/pipe/llvm/storage.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa/pipe/llvm/storage.cpp') diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/mesa/pipe/llvm/storage.cpp index ff62fcf3e49..1aaabbe8828 100644 --- a/src/mesa/pipe/llvm/storage.cpp +++ b/src/mesa/pipe/llvm/storage.cpp @@ -393,3 +393,18 @@ void Storage::popTemps() m_tempStack.pop(); } #endif //MESA_LLVM + +llvm::Value * Storage::immediateElement(int idx) +{ + return m_immediates[idx]; +} + +void Storage::addImmediate(float *val) +{ + std::vector vec(4); + vec[0] = ConstantFP::get(Type::FloatTy, APFloat(val[0])); + vec[1] = ConstantFP::get(Type::FloatTy, APFloat(val[1])); + vec[2] = ConstantFP::get(Type::FloatTy, APFloat(val[2])); + vec[3] = ConstantFP::get(Type::FloatTy, APFloat(val[3])); + m_immediates.push_back(ConstantVector::get(m_floatVecType, vec)); +} -- cgit v1.2.3