summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/llvm/storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/llvm/storage.cpp')
-rw-r--r--src/mesa/pipe/llvm/storage.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/mesa/pipe/llvm/storage.cpp
index ff62fcf3e4..1aaabbe882 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<Constant*> 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));
+}