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 | |
| 27 | mSlots = NULL; |
| 28 | mTypes = NULL; |
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; |
| 36 | mSlots = NULL; |
| 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; |
| 40 | mTypes = NULL; |
| 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 { |
| 98 | if (rsc->mHal.funcs.script.updateCachedObject != NULL) { |
| 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 |
| 173 | // not NULL-terminated. We then use setenv(), which properly handles |
| 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 | |
Jason Sams | 5fb1aeb | 2011-04-27 15:12:49 -0700 | [diff] [blame] | 190 | void rsi_ScriptForEach(Context *rsc, RsScript vs, uint32_t slot, |
| 191 | RsAllocation vain, RsAllocation vaout, |
Tim Murray | d4ecb17 | 2013-02-07 12:17:03 -0800 | [diff] [blame] | 192 | const void *params, size_t paramLen, |
| 193 | const RsScriptCall *sc, size_t scLen) { |
Jason Sams | 5fb1aeb | 2011-04-27 15:12:49 -0700 | [diff] [blame] | 194 | Script *s = static_cast<Script *>(vs); |
Stephen Hines | 5dd9d07 | 2013-04-02 00:08:32 -0700 | [diff] [blame] | 195 | // The rs.spec generated code does not handle the absence of an actual |
| 196 | // input for sc. Instead, it retains an existing pointer value (the prior |
| 197 | // field in the packed data object). This can cause confusion because |
| 198 | // drivers might now inspect bogus sc data. |
| 199 | if (scLen == 0) { |
| 200 | sc = NULL; |
| 201 | } |
Stephen Hines | 4419977 | 2012-02-21 20:13:12 -0800 | [diff] [blame] | 202 | s->runForEach(rsc, slot, |
Jason Sams | 5fb1aeb | 2011-04-27 15:12:49 -0700 | [diff] [blame] | 203 | static_cast<const Allocation *>(vain), static_cast<Allocation *>(vaout), |
Tim Murray | d4ecb17 | 2013-02-07 12:17:03 -0800 | [diff] [blame] | 204 | params, paramLen, sc); |
Jason Sams | 5fb1aeb | 2011-04-27 15:12:49 -0700 | [diff] [blame] | 205 | |
| 206 | } |
| 207 | |
Chris Wailes | 4b3c34e | 2014-06-11 12:00:29 -0700 | [diff] [blame] | 208 | void rsi_ScriptForEachMulti(Context *rsc, RsScript vs, uint32_t slot, |
| 209 | RsAllocation *vains, size_t inLen, |
| 210 | RsAllocation vaout, const void *params, |
| 211 | size_t paramLen, const RsScriptCall *sc, |
| 212 | size_t scLen) { |
| 213 | Script *s = static_cast<Script *>(vs); |
| 214 | // The rs.spec generated code does not handle the absence of an actual |
| 215 | // input for sc. Instead, it retains an existing pointer value (the prior |
| 216 | // field in the packed data object). This can cause confusion because |
| 217 | // drivers might now inspect bogus sc data. |
| 218 | if (scLen == 0) { |
| 219 | sc = NULL; |
| 220 | } |
| 221 | |
| 222 | Allocation **ains = (Allocation**)(vains); |
| 223 | |
| 224 | s->runForEach(rsc, slot, |
| 225 | const_cast<const Allocation **>(ains), inLen, |
| 226 | static_cast<Allocation *>(vaout), params, paramLen, sc); |
| 227 | |
| 228 | } |
| 229 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 230 | void rsi_ScriptInvoke(Context *rsc, RsScript vs, uint32_t slot) { |
Jason Sams | 8c6bc69 | 2009-09-16 15:04:38 -0700 | [diff] [blame] | 231 | Script *s = static_cast<Script *>(vs); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 232 | s->Invoke(rsc, slot, NULL, 0); |
Jason Sams | 8c6bc69 | 2009-09-16 15:04:38 -0700 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 236 | void rsi_ScriptInvokeData(Context *rsc, RsScript vs, uint32_t slot, void *data) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 237 | Script *s = static_cast<Script *>(vs); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 238 | s->Invoke(rsc, slot, NULL, 0); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 239 | } |
| 240 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 241 | 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] | 242 | Script *s = static_cast<Script *>(vs); |
Jason Sams | 22fa371 | 2010-05-19 17:22:57 -0700 | [diff] [blame] | 243 | s->Invoke(rsc, slot, data, len); |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 244 | } |
| 245 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 246 | void rsi_ScriptSetVarI(Context *rsc, RsScript vs, uint32_t slot, int value) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 247 | Script *s = static_cast<Script *>(vs); |
| 248 | s->setVar(slot, &value, sizeof(value)); |
| 249 | } |
| 250 | |
Jason Sams | a5eb6e1 | 2010-11-16 17:37:02 -0800 | [diff] [blame] | 251 | void rsi_ScriptSetVarObj(Context *rsc, RsScript vs, uint32_t slot, RsObjectBase value) { |
| 252 | Script *s = static_cast<Script *>(vs); |
| 253 | ObjectBase *o = static_cast<ObjectBase *>(value); |
| 254 | s->setVarObj(slot, o); |
| 255 | } |
| 256 | |
Tim Murray | 099bc26 | 2013-03-20 16:54:03 -0700 | [diff] [blame] | 257 | 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] | 258 | Script *s = static_cast<Script *>(vs); |
| 259 | s->setVar(slot, &value, sizeof(value)); |
| 260 | } |
| 261 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 262 | void rsi_ScriptSetVarF(Context *rsc, RsScript vs, uint32_t slot, float value) { |
Jason Sams | be36bf3 | 2010-05-11 14:03:58 -0700 | [diff] [blame] | 263 | Script *s = static_cast<Script *>(vs); |
| 264 | s->setVar(slot, &value, sizeof(value)); |
| 265 | } |
| 266 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 267 | void rsi_ScriptSetVarD(Context *rsc, RsScript vs, uint32_t slot, double value) { |
Stephen Hines | 6d0a074 | 2010-09-20 17:20:30 -0700 | [diff] [blame] | 268 | Script *s = static_cast<Script *>(vs); |
| 269 | s->setVar(slot, &value, sizeof(value)); |
| 270 | } |
| 271 | |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 272 | 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] | 273 | Script *s = static_cast<Script *>(vs); |
| 274 | s->setVar(slot, data, len); |
Jason Sams | fa51719 | 2009-08-13 12:59:04 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Tim Murray | 9c64239 | 2013-04-11 13:29:59 -0700 | [diff] [blame] | 277 | void rsi_ScriptGetVarV(Context *rsc, RsScript vs, uint32_t slot, void *data, size_t len) { |
| 278 | Script *s = static_cast<Script *>(vs); |
| 279 | s->getVar(slot, data, len); |
| 280 | } |
| 281 | |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 282 | void rsi_ScriptSetVarVE(Context *rsc, RsScript vs, uint32_t slot, |
| 283 | const void *data, size_t len, RsElement ve, |
Stephen Hines | ac8d146 | 2014-06-25 00:01:23 -0700 | [diff] [blame] | 284 | const uint32_t *dims, size_t dimLen) { |
Stephen Hines | 2980f07 | 2012-04-09 18:26:29 -0700 | [diff] [blame] | 285 | Script *s = static_cast<Script *>(vs); |
| 286 | Element *e = static_cast<Element *>(ve); |
| 287 | s->setVar(slot, data, len, e, dims, dimLen); |
| 288 | } |
| 289 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 290 | } |
| 291 | } |