From 67e4b8299620db2e2f33795621b23e9827604bb1 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 26 Oct 2007 14:52:10 -0400 Subject: Get basic function calls working in the shaders. --- src/mesa/pipe/llvm/storage.cpp | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (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 cba719a8bec..88ef6711cfb 100644 --- a/src/mesa/pipe/llvm/storage.cpp +++ b/src/mesa/pipe/llvm/storage.cpp @@ -46,7 +46,7 @@ using namespace llvm; Storage::Storage(llvm::BasicBlock *block, llvm::Value *out, - llvm::Value *in, llvm::Value *consts) + llvm::Value *in, llvm::Value *consts) : m_block(block), m_OUT(out), m_IN(in), m_CONST(consts), m_temps(32), m_addrs(32), @@ -331,3 +331,41 @@ llvm::Value * Storage::outputElement(int idx, llvm::Value *indIdx ) return load; } + +llvm::Value * Storage::inputPtr() const +{ + return m_IN; +} + +llvm::Value * Storage::outputPtr() const +{ + return m_OUT; +} + +llvm::Value * Storage::constPtr() const +{ + return m_CONST; +} + +void Storage::pushArguments(llvm::Value *out, llvm::Value *in, + llvm::Value *constPtr) +{ + Args arg; + arg.out = m_OUT; + arg.in = m_IN; + arg.cst = m_CONST; + m_argStack.push(arg); + + m_OUT = out; + m_IN = in; + m_CONST = constPtr; +} + +void Storage::popArguments() +{ + Args arg = m_argStack.top(); + m_OUT = arg.out; + m_IN = arg.in; + m_CONST = arg.cst; + m_argStack.pop(); +} -- cgit v1.2.3