summaryrefslogtreecommitdiff
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2014-06-11 12:00:29 -0700
committerChris Wailes <chriswailes@google.com>2014-07-08 11:46:34 -0700
commit4b3c34e6833e39bc89c2128002806b654b8e623d (patch)
treed5e1eeed6ac0e0f9b57488570680b6796ecd7735 /rsScriptC.cpp
parentcb51798a0379409c0f9927c44bbcdd772ed7ec18 (diff)
Adds support for multi-input kernels to Frameworks/RS.
This patch modifies Frameworks/RS in the following ways: * Adjusted the data-layout of the C/C++ version of RsForEachStubParamStruct to accommodate a pointer to an array of input allocations and a pointer to an array of stride sizes for each of these allocatoins. * Adds a new code path for Java code to pass multiple allocations to a RS kernel. * Packs base pointers and step values for multi-input kernels into the new RsForEachStubParamStruct members. Change-Id: I46d2834c37075b2a2407fd8b010546818a4540d1
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index ab263c83..e7ff8c7d 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -184,6 +184,38 @@ void ScriptC::runForEach(Context *rsc,
delete AString;
}
+void ScriptC::runForEach(Context *rsc,
+ uint32_t slot,
+ const Allocation ** ains,
+ size_t inLen,
+ Allocation * aout,
+ const void * usr,
+ size_t usrBytes,
+ const RsScriptCall *sc) {
+ // Trace this function call.
+ // To avoid overhead we only build the string if tracing is actually
+ // enabled.
+ String8 *AString = NULL;
+ const char *String = "";
+ if (ATRACE_ENABLED()) {
+ AString = new String8("runForEach_");
+ AString->append(mHal.info.exportedForeachFuncList[slot].first);
+ String = AString->string();
+ }
+ ATRACE_NAME(String);
+ (void)String;
+
+ Context::PushState ps(rsc);
+
+ setupGLState(rsc);
+ setupScript(rsc);
+
+ rsc->mHal.funcs.script.invokeForEachMulti(rsc, this, slot, ains, inLen, aout, usr, usrBytes, sc);
+
+ if (AString)
+ delete AString;
+}
+
void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) {
ATRACE_CALL();