diff options
| author | Chris Wailes <chriswailes@google.com> | 2014-07-16 15:18:30 -0700 |
|---|---|---|
| committer | Chris Wailes <chriswailes@google.com> | 2014-08-15 18:26:36 -0700 |
| commit | f37121300217d3b39ab66dd9c8881bcbcad932df (patch) | |
| tree | 2e06a02e490f318cc03b95b03112860e3d38e9a6 /rsScriptIntrinsic.cpp | |
| parent | cd8df40f07d88f896bea05ed06a20d1a4d5e9728 (diff) | |
| download | android_frameworks_rs-f37121300217d3b39ab66dd9c8881bcbcad932df.tar.gz android_frameworks_rs-f37121300217d3b39ab66dd9c8881bcbcad932df.tar.bz2 android_frameworks_rs-f37121300217d3b39ab66dd9c8881bcbcad932df.zip | |
Collapse code paths for single- and multi-input kernels.
This patch simplifies the RenderScript driver and CPU reference implementation
by removing the distinction between sing- and multi-input kernels in many
places. The distinction is maintained in some places due to the need to
maintain backwards compatibility. This permits the deletion of some functions
and struct members that are no longer needed. Several related functions were
also cleaned up.
Change-Id: Id70a223ea5e3aa2b0b935b2b7f9af933339ae8a4
Diffstat (limited to 'rsScriptIntrinsic.cpp')
| -rw-r--r-- | rsScriptIntrinsic.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/rsScriptIntrinsic.cpp b/rsScriptIntrinsic.cpp index 86f1c504..7461d34a 100644 --- a/rsScriptIntrinsic.cpp +++ b/rsScriptIntrinsic.cpp @@ -55,18 +55,6 @@ uint32_t ScriptIntrinsic::run(Context *rsc) { return 0; } - -void ScriptIntrinsic::runForEach(Context *rsc, - uint32_t slot, - const Allocation * ain, - Allocation * aout, - const void * usr, - size_t usrBytes, - const RsScriptCall *sc) { - - rsc->mHal.funcs.script.invokeForEach(rsc, this, slot, ain, aout, usr, usrBytes, sc); -} - void ScriptIntrinsic::runForEach(Context* rsc, uint32_t slot, const Allocation** ains, @@ -76,7 +64,18 @@ void ScriptIntrinsic::runForEach(Context* rsc, size_t usrBytes, const RsScriptCall* sc) { - rsc->mHal.funcs.script.invokeForEachMulti(rsc, this, slot, ains, inLen, aout, usr, usrBytes, sc); + if (rsc->mHal.funcs.script.invokeForEachMulti != NULL) { + rsc->mHal.funcs.script.invokeForEachMulti(rsc, this, slot, ains, inLen, + aout, usr, usrBytes, sc); + + } else if (inLen == 1) { + rsc->mHal.funcs.script.invokeForEach(rsc, this, slot, ains[0], aout, + usr, usrBytes, sc); + + } else { + rsc->setError(RS_ERROR_FATAL_DRIVER, + "Driver support for multi-input not present"); + } } void ScriptIntrinsic::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) { @@ -107,5 +106,3 @@ RsScript rsi_ScriptIntrinsicCreate(Context *rsc, uint32_t id, RsElement ve) { } } - - |
