From f37121300217d3b39ab66dd9c8881bcbcad932df Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Wed, 16 Jul 2014 15:18:30 -0700 Subject: 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 --- rsScriptC_Lib.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rsScriptC_Lib.cpp') diff --git a/rsScriptC_Lib.cpp b/rsScriptC_Lib.cpp index a41f4a79..cacb37ad 100644 --- a/rsScriptC_Lib.cpp +++ b/rsScriptC_Lib.cpp @@ -230,7 +230,17 @@ void rsrForEach(Context *rsc, Allocation *in, Allocation *out, const void *usr, uint32_t usrBytes, const RsScriptCall *call) { - target->runForEach(rsc, /* root slot */ 0, in, out, usr, usrBytes, call); + + if (in == NULL) { + target->runForEach(rsc, /* root slot */ 0, NULL, 0, out, usr, + usrBytes, call); + + } else { + const Allocation *ins[1] = {in}; + target->runForEach(rsc, /* root slot */ 0, ins, + sizeof(ins) / sizeof(RsAllocation), out, usr, + usrBytes, call); + } } void rsrAllocationSyncAll(Context *rsc, Allocation *a, RsAllocationUsageType usage) { -- cgit v1.2.3