summaryrefslogtreecommitdiff
path: root/rsScript.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-09-10 17:40:41 -0700
committerStephen Hines <srhines@google.com>2013-09-10 18:13:28 -0700
commitc78839b5bbcffae7d64a5a1c9aa60c9a4c5d3918 (patch)
tree92c7b189452259dd5f103394ee4d5701275297a2 /rsScript.cpp
parent17e3cdc24776d8fdbf1ce16287b9b4dcd516708f (diff)
Detect use of RS objects in kernels to disable a ScriptGroup optimization.
Bug: 10394865 This change disables a ScriptGroup optimization when we can't guarantee that there is no implicit ordering between two kernels. In this case, it is possible to communicate between kernels using the same bound global RS object (like Allocation). A subsequent kernel in the ScriptGroup could accidentally pick up stale data, leading to incorrect results. Now, we disable this optimization whenever we see binds/sets of variables that are potentiall RS object types for a given Script/kernel. This is overly conservative, but sufficient for now. This change also fixes a small issue with preLaunch/postLaunch missing for the default ScriptGroup execution case. Change-Id: I0d19d200cc8dc397d68008a4df6ea423b1e4d04f
Diffstat (limited to 'rsScript.cpp')
-rw-r--r--rsScript.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/rsScript.cpp b/rsScript.cpp
index 4e8ba1ec..7857667c 100644
--- a/rsScript.cpp
+++ b/rsScript.cpp
@@ -27,6 +27,7 @@ Script::Script(Context *rsc) : ObjectBase(rsc) {
mSlots = NULL;
mTypes = NULL;
mInitialized = false;
+ mHasObjectSlots = false;
}
Script::~Script() {
@@ -48,6 +49,7 @@ void Script::setSlot(uint32_t slot, Allocation *a) {
}
mSlots[slot].set(a);
+ mHasObjectSlots = true;
mRSC->mHal.funcs.script.setGlobalBind(mRSC, this, slot, a);
}
@@ -85,6 +87,7 @@ void Script::setVarObj(uint32_t slot, ObjectBase *val) {
ALOGE("Script::setVarObj unable to set allocation, invalid slot index");
return;
}
+ mHasObjectSlots = true;
//ALOGE("setvarobj %i %p", slot, val);
mRSC->mHal.funcs.script.setGlobalObj(mRSC, this, slot, val);
}