summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-06-13 15:16:44 -0700
committerJason Sams <jsams@google.com>2012-06-13 16:05:53 -0700
commit9d6b2b359c43a388090aa34b3a558c262214192b (patch)
tree2f1979b0a884d3ae01668c6be807873e37fb5599
parent433d5f43151a21e4403dc69ffebe0895ddb0905b (diff)
downloadrs-jb-release.tar.gz
No longer mark scripts single threaded just because a forEach is present. Change-Id: I617cb2b1ccb402526a78338612b1614f94da4efb
-rw-r--r--driver/rsdBcc.cpp4
-rw-r--r--driver/rsdCore.h1
-rw-r--r--driver/rsdRuntimeStubs.cpp10
3 files changed, 9 insertions, 6 deletions
diff --git a/driver/rsdBcc.cpp b/driver/rsdBcc.cpp
index 29780e65..457a99d7 100644
--- a/driver/rsdBcc.cpp
+++ b/driver/rsdBcc.cpp
@@ -397,12 +397,14 @@ void rsdScriptInvokeForEach(const Context *rsc,
mtls.yStrideOut = aout->mHal.drvState.stride;
}
- if ((dc->mWorkers.mCount > 1) && s->mHal.info.isThreadable) {
+ if ((dc->mWorkers.mCount > 1) && s->mHal.info.isThreadable && !dc->mInForEach) {
+ dc->mInForEach = true;
if (mtls.dimY > 1) {
rsdLaunchThreads(mrsc, wc_xy, &mtls);
} else {
rsdLaunchThreads(mrsc, wc_x, &mtls);
}
+ dc->mInForEach = false;
//ALOGE("launch 1");
} else {
diff --git a/driver/rsdCore.h b/driver/rsdCore.h
index 05ca13bb..92e7c7f9 100644
--- a/driver/rsdCore.h
+++ b/driver/rsdCore.h
@@ -43,6 +43,7 @@ typedef struct RsdHalRec {
uint32_t version_major;
uint32_t version_minor;
bool mHasGraphics;
+ bool mInForEach;
struct Workers {
volatile int mRunningCount;
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp
index 779076da..a24bba89 100644
--- a/driver/rsdRuntimeStubs.cpp
+++ b/driver/rsdRuntimeStubs.cpp
@@ -661,11 +661,11 @@ static RsdSymbolTable gSyms[] = {
{ "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false },
{ "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false },
- { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, false },
- { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, false },
- { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK16rs_script_call_t", (void *)&SC_ForEach_SAAUS, false },
- { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, false },
- { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK16rs_script_call_t", (void *)&SC_ForEach_SAAULS, false },
+ { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, true },
+ { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, true },
+ { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK16rs_script_call_t", (void *)&SC_ForEach_SAAUS, true },
+ { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, true },
+ { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK16rs_script_call_t", (void *)&SC_ForEach_SAAULS, true },
// time
{ "_Z6rsTimePi", (void *)&SC_Time, true },