summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Murray <timmurray@google.com> 2014-02-03 14:41:39 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2014-02-03 14:41:39 -0800
commitb1bec0d916c00c7ceb09c691f1e5977909ba698d (patch)
tree89080659b76cea14741b8a52e453b06c3f244bda
parent67d9e0be8e4ff709c03865c3b4ac9f40d5dcfdbb (diff)
parent3fb6feacc62e1021c705b53d46e915ecf50582d2 (diff)
am 3fb6feac: Merge "Check that bound allocations are 1D"
* commit '3fb6feacc62e1021c705b53d46e915ecf50582d2': Check that bound allocations are 1D
-rw-r--r--rs/java/android/renderscript/Script.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index 5ab18f744c2b..a1f228718436 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -188,6 +188,13 @@ public class Script extends BaseObj {
public void bindAllocation(Allocation va, int slot) {
mRS.validate();
if (va != null) {
+ if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 20) {
+ final Type t = va.mType;
+ if (t.hasMipmaps() || t.hasFaces() || (t.getY() != 0) || (t.getZ() != 0)) {
+ throw new RSIllegalArgumentException(
+ "API 20+ only allows simple 1D allocations to be used with bind.");
+ }
+ }
mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot);
} else {
mRS.nScriptBindAllocation(getID(mRS), 0, slot);