Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 136ff9f6 authored by Jason Sams's avatar Jason Sams Committed by Android Git Automerger
Browse files

am bdc223a7: Merge "Check that bound allocations are 1D"

* commit 'bdc223a7':
  Check that bound allocations are 1D
parents 983a967e bdc223a7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);