diff options
author | Zack Rusin <[email protected]> | 2007-10-29 10:59:24 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-10-30 05:15:05 -0400 |
commit | b0f3b5910ebd0737600ab7b1fdc135d74f2617f4 (patch) | |
tree | 2e4ebcc7f6d13ea151aac92cd3f19741a0bf0845 /src/mesa/pipe/llvm/storage.cpp | |
parent | 8b2f997af572dd3aca00c4888adf2b0a60656331 (diff) |
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.
Diffstat (limited to 'src/mesa/pipe/llvm/storage.cpp')
-rw-r--r-- | src/mesa/pipe/llvm/storage.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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<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)); +} |