Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
Stephen Hines | 4419977 | 2012-02-21 20:13:12 -0800 | [diff] [blame] | 2 | * Copyright (C) 2009-2012 The Android Open Source Project |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "rsContext.h" |
Stephen Hines | d2432b9 | 2011-11-09 18:02:20 -0800 | [diff] [blame] | 18 | #include <time.h> |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 19 | |
| 20 | using namespace android; |
| 21 | using namespace android::renderscript; |
| 22 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 23 | Script::Script(Context *rsc) : ObjectBase(rsc) { |
Jason Sams | 928b734 | 2009-06-08 18:50:13 -0700 | [diff] [blame] | 24 | memset(&mEnviroment, 0, sizeof(mEnviroment)); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 25 | memset(&mHal, 0, sizeof(mHal)); |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 26 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 27 | mSlots = nullptr; |
| 28 | mTypes = nullptr; |
Jason Sams | 77020c5 | 2011-11-22 12:49:11 -0800 | [diff] [blame] | 29 | mInitialized = false; |
Stephen Hines | c78839b | 2013-09-10 17:40:41 -0700 | [diff] [blame] | 30 | mHasObjectSlots = false; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 33 | Script::~Script() { |
| 34 | if (mSlots) { |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 35 | delete [] mSlots; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 36 | mSlots = nullptr; |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 37 | } |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 38 | if (mTypes) { |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 39 | delete [] mTypes; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 40 | mTypes = nullptr; |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 44 | void Script::setSlot(uint32_t slot, Allocation *a) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 45 | //ALOGE("setSlot %i %p", slot, a); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 46 | if (slot >= mHal.info.exportedVariableCount) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 47 | ALOGE("Script::setSlot unable to set allocation, invalid slot index"); |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 48 | return; |
| 49 | } |
| 50 | |
| 51 | mSlots[slot].set(a); |
Stephen Hines | c78839b | 2013-09-10 17:40:41 -0700 | [diff] [blame] | 52 | mHasObjectSlots = true; |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 53 | mRSC->mHal.funcs.script.setGlobalBind(mRSC, this, slot, a); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 56 | void Script::setVar(uint32_t slot, const void *val, size_t len) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 57 | //ALOGE("setVar %i %p %i", slot, val, len); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 58 | if (slot >= mHal.info.exportedVariableCount) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 59 | ALOGE("Script::setVar unable to set allocation, invalid slot index"); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 60 | return; |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 61 | } |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 62 | mRSC->mHal.funcs.script.setGlobalVar(mRSC, this, slot, (void *)val, len); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 63 | } |
| 64 | |
Tim Murray | 9c64239 | 2013-04-11 13:29:59 -0700 | [diff] [blame] | 65 | void Script::getVar(uint32_t slot, const void *val, size_t len) { |
| 66 | //ALOGE("getVar %i %p %i", slot, val, len); |
| 67 | if (slot >= mHal.info.exportedVariableCount) { |
Stephen Hines | cadee38 | 2013-12-12 13:21:00 -0800 | [diff] [blame] | 68 | ALOGE("Script::getVar unable to set allocation, invalid slot index: " |
Nick Kralevich | 02759d7 | 2013-12-15 21:04:00 -0800 | [diff] [blame] | 69 | "%u >= %zu", slot, mHal.info.exportedVariableCount); |
Tim Murray | 9c64239 | 2013-04-11 13:29:59 -0700 | [diff] [blame] | 70 | return; |
| 71 | } |
| 72 | mRSC->mHal.funcs.script.getGlobalVar(mRSC, this, slot, (void *)val, len); |
| 73 | } |
| 74 | |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 75 | void Script::setVar(uint32_t slot, const void *val, size_t len, Element *e, |
Stephen Hines | f0a5078 | 2014-06-25 13:41:10 -0700 | [diff] [blame] | 76 | const uint32_t *dims, size_t dimLen) { |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 77 | if (slot >= mHal.info.exportedVariableCount) { |
Stephen Hines | cadee38 | 2013-12-12 13:21:00 -0800 | [diff] [blame] | 78 | ALOGE("Script::setVar unable to set allocation, invalid slot index: " |
Nick Kralevich | 02759d7 | 2013-12-15 21:04:00 -0800 | [diff] [blame] | 79 | "%u >= %zu", slot, mHal.info.exportedVariableCount); |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 80 | return; |
| 81 | } |
| 82 | mRSC->mHal.funcs.script.setGlobalVarWithElemDims(mRSC, this, slot, |
| 83 | (void *)val, len, e, dims, dimLen); |
| 84 | } |
| 85 | |
Jason Sams | a5eb6e1 | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 86 | void Script::setVarObj(uint32_t slot, ObjectBase *val) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 87 | //ALOGE("setVarObj %i %p", slot, val); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 88 | if (slot >= mHal.info.exportedVariableCount) { |
Stephen Hines | cadee38 | 2013-12-12 13:21:00 -0800 | [diff] [blame] | 89 | ALOGE("Script::setVarObj unable to set allocation, invalid slot index: " |
Nick Kralevich | 02759d7 | 2013-12-15 21:04:00 -0800 | [diff] [blame] | 90 | "%u >= %zu", slot, mHal.info.exportedVariableCount); |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 91 | return; |
Jason Sams | a5eb6e1 | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 92 | } |
Stephen Hines | c78839b | 2013-09-10 17:40:41 -0700 | [diff] [blame] | 93 | mHasObjectSlots = true; |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 94 | mRSC->mHal.funcs.script.setGlobalObj(mRSC, this, slot, val); |
Jason Sams | a5eb6e1 | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 95 | } |
| 96 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 97 | void Script::callUpdateCacheObject(const Context *rsc, void *dstObj) const { |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 98 | if (rsc->mHal.funcs.script.updateCachedObject != nullptr) { |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 99 | rsc->mHal.funcs.script.updateCachedObject(rsc, this, (rs_script *)dstObj); |
| 100 | } else { |
| 101 | *((const void **)dstObj) = this; |
| 102 | } |
| 103 | } |
| 104 | |
Stephen Hines | 4ee16ff | 2011-08-31 17:41:39 -0700 | [diff] [blame] | 105 | bool Script::freeChildren() { |
| 106 | incSysRef(); |
| 107 | mRSC->mHal.funcs.script.invokeFreeChildren(mRSC, this); |
| 108 | return decSysRef(); |
| 109 | } |
| 110 | |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 111 | ScriptKernelID::ScriptKernelID(Context *rsc, Script *s, int slot, int sig) |
| 112 | : ObjectBase(rsc) { |
| 113 | |
| 114 | mScript = s; |
| 115 | mSlot = slot; |
| 116 | mHasKernelInput = (sig & 1) != 0; |
| 117 | mHasKernelOutput = (sig & 2) != 0; |
| 118 | } |
| 119 | |
| 120 | ScriptKernelID::~ScriptKernelID() { |
| 121 | |
| 122 | } |
| 123 | |
| 124 | void ScriptKernelID::serialize(Context *rsc, OStream *stream) const { |
| 125 | |
| 126 | } |
| 127 | |
| 128 | RsA3DClassID ScriptKernelID::getClassId() const { |
| 129 | return RS_A3D_CLASS_ID_SCRIPT_KERNEL_ID; |
| 130 | } |
| 131 | |
| 132 | ScriptFieldID::ScriptFieldID(Context *rsc, Script *s, int slot) : ObjectBase(rsc) { |
| 133 | mScript = s; |
| 134 | mSlot = slot; |
| 135 | } |
| 136 | |
| 137 | ScriptFieldID::~ScriptFieldID() { |
| 138 | |
| 139 | } |
| 140 | |
| 141 | void ScriptFieldID::serialize(Context *rsc, OStream *stream) const { |
| 142 | |
| 143 | } |
| 144 | |
| 145 | RsA3DClassID ScriptFieldID::getClassId() const { |
| 146 | return RS_A3D_CLASS_ID_SCRIPT_FIELD_ID; |
| 147 | } |
| 148 | |
| 149 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 150 | namespace android { |
| 151 | namespace renderscript { |
| 152 | |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 153 | RsScriptKernelID rsi_ScriptKernelIDCreate(Context *rsc, RsScript vs, int slot, int sig) { |
Stephen Hines | 61c8695 | 2013-04-09 17:34:43 -0700 | [diff] [blame] | 154 | ScriptKernelID *kid = new ScriptKernelID(rsc, (Script *)vs, slot, sig); |
| 155 | kid->incUserRef(); |
| 156 | return kid; |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | RsScriptFieldID rsi_ScriptFieldIDCreate(Context *rsc, RsScript vs, int slot) { |
Stephen Hines | 61c8695 | 2013-04-09 17:34:43 -0700 | [diff] [blame] | 160 | ScriptFieldID *fid = new ScriptFieldID(rsc, (Script *)vs, slot); |
| 161 | fid->incUserRef(); |
| 162 | return fid; |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 163 | } |
| 164 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 165 | void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot) { |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 166 | Script *s = static_cast<Script *>(vs); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 167 | Allocation *a = static_cast<Allocation *>(va); |
Alex Sakhartchouk | 700ba38 | 2010-10-08 15:00:05 -0700 | [diff] [blame] | 168 | s->setSlot(slot, a); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 169 | } |
| 170 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 171 | void rsi_ScriptSetTimeZone(Context * rsc, RsScript vs, const char * timeZone, size_t length) { |
Stephen Hines | d2432b9 | 2011-11-09 18:02:20 -0800 | [diff] [blame] | 172 | // We unfortunately need to make a new copy of the string, since it is |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 173 | // not nullptr-terminated. We then use setenv(), which properly handles |
Stephen Hines | d2432b9 | 2011-11-09 18:02:20 -0800 | [diff] [blame] | 174 | // freeing/duplicating the actual string for the environment. |
| 175 | char *tz = (char *) malloc(length + 1); |
| 176 | if (!tz) { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 177 | ALOGE("Couldn't allocate memory for timezone buffer"); |
Stephen Hines | d2432b9 | 2011-11-09 18:02:20 -0800 | [diff] [blame] | 178 | return; |
| 179 | } |
| 180 | strncpy(tz, timeZone, length); |
| 181 | tz[length] = '\0'; |
| 182 | if (setenv("TZ", tz, 1) == 0) { |
| 183 | tzset(); |
| 184 | } else { |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 185 | ALOGE("Error setting timezone"); |
Stephen Hines | d2432b9 | 2011-11-09 18:02:20 -0800 | [diff] [blame] | 186 | } |
| 187 | free(tz); |
Jason Sams | d34b725 | 2009-08-04 16:58:20 -0700 | [diff] [blame] | 188 | } |
| 189 | |
Chris Wailes | 4b3c34e | 2014-06-11 12:00:29 -0700 | [diff] [blame] | 190 | void rsi_ScriptForEachMulti(Context *rsc, RsScript vs, uint32_t slot, |
| 191 | RsAllocation *vains, size_t inLen, |
| 192 | RsAllocation vaout, const void *params, |
| 193 | size_t paramLen, const RsScriptCall *sc, |
| 194 | size_t scLen) { |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 195 | |
| 196 | Script *s = static_cast<Script *>(vs); |
Chris Wailes | 4b3c34e | 2014-06-11 12:00:29 -0700 | [diff] [blame] | 197 | Allocation **ains = (Allocation**)(vains); |
| 198 | |
| 199 | s->runForEach(rsc, slot, |
| 200 | const_cast<const Allocation **>(ains), inLen, |
| 201 | static_cast<Allocation *>(vaout), params, paramLen, sc); |
| 202 | |
| 203 | } |
| 204 | |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 205 | void rsi_ScriptForEach(Context *rsc, RsScript vs, uint32_t slot, |
| 206 | RsAllocation vain, RsAllocation vaout, |
| 207 | const void *params, size_t paramLen, |
| 208 | const RsScriptCall *sc, size_t scLen) { |
| 209 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 210 | if (vain == nullptr) { |
| 211 | rsi_ScriptForEachMulti(rsc, vs, slot, nullptr, 0, vaout, params, paramLen, |
Chris Wailes | f371213 | 2014-07-16 15:18:30 -0700 | [diff] [blame] | 212 | sc, scLen); |
| 213 | } else { |
| 214 | RsAllocation ains[1] = {vain}; |
| 215 | |
| 216 | rsi_ScriptForEachMulti(rsc, vs, slot, ains, |
| 217 | sizeof(ains) / sizeof(RsAllocation), vaout, |
| 218 | params, paramLen, sc, scLen); |
| 219 | } |
| 220 | } |
| 221 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 222 | void rsi_ScriptInvoke(Context *rsc, RsScript vs, uint32_t slot) { |
Jason Sams | 8c6bc69 | 2009-09-16 15:04:38 -0700 | [diff] [blame] | 223 | Script *s = static_cast<Script *>(vs); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 224 | s->Invoke(rsc, slot, nullptr, 0); |
Jason Sams | 8c6bc69 | 2009-09-16 15:04:38 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 228 | void rsi_ScriptInvokeData(Context *rsc, RsScript vs, uint32_t slot, void *data) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 229 | Script *s = static_cast<Script *>(vs); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 230 | s->Invoke(rsc, slot, nullptr, 0); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 231 | } |
| 232 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 233 | void rsi_ScriptInvokeV(Context *rsc, RsScript vs, uint32_t slot, const void *data, size_t len) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 234 | Script *s = static_cast<Script *>(vs); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 235 | s->Invoke(rsc, slot, data, len); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 236 | } |
| 237 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 238 | void rsi_ScriptSetVarI(Context *rsc, RsScript vs, uint32_t slot, int value) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 239 | Script *s = static_cast<Script *>(vs); |
| 240 | s->setVar(slot, &value, sizeof(value)); |
| 241 | } |
| 242 | |
Jason Sams | a5eb6e1 | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 243 | void rsi_ScriptSetVarObj(Context *rsc, RsScript vs, uint32_t slot, RsObjectBase value) { |
| 244 | Script *s = static_cast<Script *>(vs); |
| 245 | ObjectBase *o = static_cast<ObjectBase *>(value); |
| 246 | s->setVarObj(slot, o); |
| 247 | } |
| 248 | |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 249 | void rsi_ScriptSetVarJ(Context *rsc, RsScript vs, uint32_t slot, int64_t value) { |
Stephen Hines | 0977c94 | 2010-10-11 10:54:21 -0700 | [diff] [blame] | 250 | Script *s = static_cast<Script *>(vs); |
| 251 | s->setVar(slot, &value, sizeof(value)); |
| 252 | } |
| 253 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 254 | void rsi_ScriptSetVarF(Context *rsc, RsScript vs, uint32_t slot, float value) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 255 | Script *s = static_cast<Script *>(vs); |
| 256 | s->setVar(slot, &value, sizeof(value)); |
| 257 | } |
| 258 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 259 | void rsi_ScriptSetVarD(Context *rsc, RsScript vs, uint32_t slot, double value) { |
Stephen Hines | 6d0a074 | 2010-09-20 17:20:30 -0700 | [diff] [blame] | 260 | Script *s = static_cast<Script *>(vs); |
| 261 | s->setVar(slot, &value, sizeof(value)); |
| 262 | } |
| 263 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 264 | void rsi_ScriptSetVarV(Context *rsc, RsScript vs, uint32_t slot, const void *data, size_t len) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 265 | Script *s = static_cast<Script *>(vs); |
| 266 | s->setVar(slot, data, len); |
Jason Sams | fa51719 | 2009-08-13 12:59:04 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Tim Murray | 9c64239 | 2013-04-11 13:29:59 -0700 | [diff] [blame] | 269 | void rsi_ScriptGetVarV(Context *rsc, RsScript vs, uint32_t slot, void *data, size_t len) { |
| 270 | Script *s = static_cast<Script *>(vs); |
| 271 | s->getVar(slot, data, len); |
| 272 | } |
| 273 | |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 274 | void rsi_ScriptSetVarVE(Context *rsc, RsScript vs, uint32_t slot, |
| 275 | const void *data, size_t len, RsElement ve, |
Stephen Hines | ac8d146 | 2014-06-25 00:01:23 -0700 | [diff] [blame] | 276 | const uint32_t *dims, size_t dimLen) { |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 277 | Script *s = static_cast<Script *>(vs); |
| 278 | Element *e = static_cast<Element *>(ve); |
| 279 | s->setVar(slot, data, len, e, dims, dimLen); |
| 280 | } |
| 281 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 282 | } |
| 283 | } |