rsdRuntimeStubs.cpp revision 5261a5ea546ff358edd5aac7602fc4132434f481
1/*
2 * Copyright (C) 2011-2012 The Android Open Source Project
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"
18#include "rsScriptC.h"
19#include "rsMatrix4x4.h"
20#include "rsMatrix3x3.h"
21#include "rsMatrix2x2.h"
22#include "rsRuntime.h"
23
24#include "utils/Timers.h"
25#include "rsdCore.h"
26#include "rsdBcc.h"
27
28#include "rsdPath.h"
29#include "rsdAllocation.h"
30#include "rsdShaderCache.h"
31#include "rsdVertexArray.h"
32
33#include <time.h>
34
35using namespace android;
36using namespace android::renderscript;
37
38typedef float float2 __attribute__((ext_vector_type(2)));
39typedef float float3 __attribute__((ext_vector_type(3)));
40typedef float float4 __attribute__((ext_vector_type(4)));
41typedef double double2 __attribute__((ext_vector_type(2)));
42typedef double double3 __attribute__((ext_vector_type(3)));
43typedef double double4 __attribute__((ext_vector_type(4)));
44typedef char char2 __attribute__((ext_vector_type(2)));
45typedef char char3 __attribute__((ext_vector_type(3)));
46typedef char char4 __attribute__((ext_vector_type(4)));
47typedef unsigned char uchar2 __attribute__((ext_vector_type(2)));
48typedef unsigned char uchar3 __attribute__((ext_vector_type(3)));
49typedef unsigned char uchar4 __attribute__((ext_vector_type(4)));
50typedef short short2 __attribute__((ext_vector_type(2)));
51typedef short short3 __attribute__((ext_vector_type(3)));
52typedef short short4 __attribute__((ext_vector_type(4)));
53typedef unsigned short ushort2 __attribute__((ext_vector_type(2)));
54typedef unsigned short ushort3 __attribute__((ext_vector_type(3)));
55typedef unsigned short ushort4 __attribute__((ext_vector_type(4)));
56typedef int32_t int2 __attribute__((ext_vector_type(2)));
57typedef int32_t int3 __attribute__((ext_vector_type(3)));
58typedef int32_t int4 __attribute__((ext_vector_type(4)));
59typedef uint32_t uint2 __attribute__((ext_vector_type(2)));
60typedef uint32_t uint3 __attribute__((ext_vector_type(3)));
61typedef uint32_t uint4 __attribute__((ext_vector_type(4)));
62typedef long long long2 __attribute__((ext_vector_type(2)));
63typedef long long long3 __attribute__((ext_vector_type(3)));
64typedef long long long4 __attribute__((ext_vector_type(4)));
65typedef unsigned long long ulong2 __attribute__((ext_vector_type(2)));
66typedef unsigned long long ulong3 __attribute__((ext_vector_type(3)));
67typedef unsigned long long ulong4 __attribute__((ext_vector_type(4)));
68
69typedef uint8_t uchar;
70typedef uint16_t ushort;
71typedef uint32_t uint;
72typedef uint64_t ulong;
73
74//////////////////////////////////////////////////////////////////////////////
75// Allocation
76//////////////////////////////////////////////////////////////////////////////
77
78
79static void SC_AllocationSyncAll2(Allocation *a, RsAllocationUsageType source) {
80    Context *rsc = RsdCpuReference::getTlsContext();
81    rsrAllocationSyncAll(rsc, a, source);
82}
83
84static void SC_AllocationSyncAll(Allocation *a) {
85    Context *rsc = RsdCpuReference::getTlsContext();
86    rsrAllocationSyncAll(rsc, a, RS_ALLOCATION_USAGE_SCRIPT);
87}
88
89static void SC_AllocationCopy1DRange(Allocation *dstAlloc,
90                                     uint32_t dstOff,
91                                     uint32_t dstMip,
92                                     uint32_t count,
93                                     Allocation *srcAlloc,
94                                     uint32_t srcOff, uint32_t srcMip) {
95    Context *rsc = RsdCpuReference::getTlsContext();
96    rsrAllocationCopy1DRange(rsc, dstAlloc, dstOff, dstMip, count,
97                             srcAlloc, srcOff, srcMip);
98}
99
100static void SC_AllocationCopy2DRange(Allocation *dstAlloc,
101                                     uint32_t dstXoff, uint32_t dstYoff,
102                                     uint32_t dstMip, uint32_t dstFace,
103                                     uint32_t width, uint32_t height,
104                                     Allocation *srcAlloc,
105                                     uint32_t srcXoff, uint32_t srcYoff,
106                                     uint32_t srcMip, uint32_t srcFace) {
107    Context *rsc = RsdCpuReference::getTlsContext();
108    rsrAllocationCopy2DRange(rsc, dstAlloc,
109                             dstXoff, dstYoff, dstMip, dstFace,
110                             width, height,
111                             srcAlloc,
112                             srcXoff, srcYoff, srcMip, srcFace);
113}
114
115static void SC_AllocationIoSend(Allocation *alloc) {
116    Context *rsc = RsdCpuReference::getTlsContext();
117    rsdAllocationIoSend(rsc, alloc);
118}
119
120
121static void SC_AllocationIoReceive(Allocation *alloc) {
122    Context *rsc = RsdCpuReference::getTlsContext();
123    rsdAllocationIoReceive(rsc, alloc);
124}
125
126
127
128//////////////////////////////////////////////////////////////////////////////
129// Context
130//////////////////////////////////////////////////////////////////////////////
131
132static void SC_BindTexture(ProgramFragment *pf, uint32_t slot, Allocation *a) {
133    Context *rsc = RsdCpuReference::getTlsContext();
134    rsrBindTexture(rsc, pf, slot, a);
135}
136
137static void SC_BindVertexConstant(ProgramVertex *pv, uint32_t slot, Allocation *a) {
138    Context *rsc = RsdCpuReference::getTlsContext();
139    rsrBindConstant(rsc, pv, slot, a);
140}
141
142static void SC_BindFragmentConstant(ProgramFragment *pf, uint32_t slot, Allocation *a) {
143    Context *rsc = RsdCpuReference::getTlsContext();
144    rsrBindConstant(rsc, pf, slot, a);
145}
146
147static void SC_BindSampler(ProgramFragment *pf, uint32_t slot, Sampler *s) {
148    Context *rsc = RsdCpuReference::getTlsContext();
149    rsrBindSampler(rsc, pf, slot, s);
150}
151
152static void SC_BindProgramStore(ProgramStore *ps) {
153    Context *rsc = RsdCpuReference::getTlsContext();
154    rsrBindProgramStore(rsc, ps);
155}
156
157static void SC_BindProgramFragment(ProgramFragment *pf) {
158    Context *rsc = RsdCpuReference::getTlsContext();
159    rsrBindProgramFragment(rsc, pf);
160}
161
162static void SC_BindProgramVertex(ProgramVertex *pv) {
163    Context *rsc = RsdCpuReference::getTlsContext();
164    rsrBindProgramVertex(rsc, pv);
165}
166
167static void SC_BindProgramRaster(ProgramRaster *pr) {
168    Context *rsc = RsdCpuReference::getTlsContext();
169    rsrBindProgramRaster(rsc, pr);
170}
171
172static void SC_BindFrameBufferObjectColorTarget(Allocation *a, uint32_t slot) {
173    Context *rsc = RsdCpuReference::getTlsContext();
174    rsrBindFrameBufferObjectColorTarget(rsc, a, slot);
175}
176
177static void SC_BindFrameBufferObjectDepthTarget(Allocation *a) {
178    Context *rsc = RsdCpuReference::getTlsContext();
179    rsrBindFrameBufferObjectDepthTarget(rsc, a);
180}
181
182static void SC_ClearFrameBufferObjectColorTarget(uint32_t slot) {
183    Context *rsc = RsdCpuReference::getTlsContext();
184    rsrClearFrameBufferObjectColorTarget(rsc, slot);
185}
186
187static void SC_ClearFrameBufferObjectDepthTarget(Context *, Script *) {
188    Context *rsc = RsdCpuReference::getTlsContext();
189    rsrClearFrameBufferObjectDepthTarget(rsc);
190}
191
192static void SC_ClearFrameBufferObjectTargets(Context *, Script *) {
193    Context *rsc = RsdCpuReference::getTlsContext();
194    rsrClearFrameBufferObjectTargets(rsc);
195}
196
197
198//////////////////////////////////////////////////////////////////////////////
199// VP
200//////////////////////////////////////////////////////////////////////////////
201
202static void SC_VpLoadProjectionMatrix(const rsc_Matrix *m) {
203    Context *rsc = RsdCpuReference::getTlsContext();
204    rsrVpLoadProjectionMatrix(rsc, m);
205}
206
207static void SC_VpLoadModelMatrix(const rsc_Matrix *m) {
208    Context *rsc = RsdCpuReference::getTlsContext();
209    rsrVpLoadModelMatrix(rsc, m);
210}
211
212static void SC_VpLoadTextureMatrix(const rsc_Matrix *m) {
213    Context *rsc = RsdCpuReference::getTlsContext();
214    rsrVpLoadTextureMatrix(rsc, m);
215}
216
217static void SC_PfConstantColor(ProgramFragment *pf, float r, float g, float b, float a) {
218    Context *rsc = RsdCpuReference::getTlsContext();
219    rsrPfConstantColor(rsc, pf, r, g, b, a);
220}
221
222static void SC_VpGetProjectionMatrix(rsc_Matrix *m) {
223    Context *rsc = RsdCpuReference::getTlsContext();
224    rsrVpGetProjectionMatrix(rsc, m);
225}
226
227
228//////////////////////////////////////////////////////////////////////////////
229// Drawing
230//////////////////////////////////////////////////////////////////////////////
231
232static void SC_DrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
233                                 float x2, float y2, float z2, float u2, float v2,
234                                 float x3, float y3, float z3, float u3, float v3,
235                                 float x4, float y4, float z4, float u4, float v4) {
236    Context *rsc = RsdCpuReference::getTlsContext();
237
238    if (!rsc->setupCheck()) {
239        return;
240    }
241
242    RsdHal *dc = (RsdHal *)rsc->mHal.drv;
243    if (!dc->gl.shaderCache->setup(rsc)) {
244        return;
245    }
246
247    //ALOGE("Quad");
248    //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1);
249    //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2);
250    //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3);
251    //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4);
252
253    float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4};
254    const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4};
255
256    RsdVertexArray::Attrib attribs[2];
257    attribs[0].set(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "ATTRIB_position");
258    attribs[1].set(GL_FLOAT, 2, 8, false, (uint32_t)tex, "ATTRIB_texture0");
259
260    RsdVertexArray va(attribs, 2);
261    va.setup(rsc);
262
263    RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4);
264}
265
266static void SC_DrawQuad(float x1, float y1, float z1,
267                        float x2, float y2, float z2,
268                        float x3, float y3, float z3,
269                        float x4, float y4, float z4) {
270    SC_DrawQuadTexCoords(x1, y1, z1, 0, 1,
271                         x2, y2, z2, 1, 1,
272                         x3, y3, z3, 1, 0,
273                         x4, y4, z4, 0, 0);
274}
275
276static void SC_DrawSpriteScreenspace(float x, float y, float z, float w, float h) {
277    Context *rsc = RsdCpuReference::getTlsContext();
278
279    ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex());
280    rsc->setProgramVertex(rsc->getDefaultProgramVertex());
281    //rsc->setupCheck();
282
283    //GLint crop[4] = {0, h, w, -h};
284
285    float sh = rsc->getHeight();
286
287    SC_DrawQuad(x,   sh - y,     z,
288                x+w, sh - y,     z,
289                x+w, sh - (y+h), z,
290                x,   sh - (y+h), z);
291    rsc->setProgramVertex((ProgramVertex *)tmp.get());
292}
293
294static void SC_DrawRect(float x1, float y1, float x2, float y2, float z) {
295    SC_DrawQuad(x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z);
296}
297
298static void SC_DrawPath(Path *p) {
299    Context *rsc = RsdCpuReference::getTlsContext();
300    rsdPathDraw(rsc, p);
301}
302
303static void SC_DrawMesh(Mesh *m) {
304    Context *rsc = RsdCpuReference::getTlsContext();
305    rsrDrawMesh(rsc, m);
306}
307
308static void SC_DrawMeshPrimitive(Mesh *m, uint32_t primIndex) {
309    Context *rsc = RsdCpuReference::getTlsContext();
310    rsrDrawMeshPrimitive(rsc, m, primIndex);
311}
312
313static void SC_DrawMeshPrimitiveRange(Mesh *m, uint32_t primIndex, uint32_t start, uint32_t len) {
314    Context *rsc = RsdCpuReference::getTlsContext();
315    rsrDrawMeshPrimitiveRange(rsc, m, primIndex, start, len);
316}
317
318static void SC_MeshComputeBoundingBox(Mesh *m,
319                               float *minX, float *minY, float *minZ,
320                               float *maxX, float *maxY, float *maxZ) {
321    Context *rsc = RsdCpuReference::getTlsContext();
322    rsrMeshComputeBoundingBox(rsc, m, minX, minY, minZ, maxX, maxY, maxZ);
323}
324
325
326
327//////////////////////////////////////////////////////////////////////////////
328//
329//////////////////////////////////////////////////////////////////////////////
330
331
332static void SC_Color(float r, float g, float b, float a) {
333    Context *rsc = RsdCpuReference::getTlsContext();
334    rsrColor(rsc, r, g, b, a);
335}
336
337static void SC_Finish() {
338    Context *rsc = RsdCpuReference::getTlsContext();
339    rsdGLFinish(rsc);
340}
341
342static void SC_ClearColor(float r, float g, float b, float a) {
343    Context *rsc = RsdCpuReference::getTlsContext();
344    rsrPrepareClear(rsc);
345    rsdGLClearColor(rsc, r, g, b, a);
346}
347
348static void SC_ClearDepth(float v) {
349    Context *rsc = RsdCpuReference::getTlsContext();
350    rsrPrepareClear(rsc);
351    rsdGLClearDepth(rsc, v);
352}
353
354static uint32_t SC_GetWidth() {
355    Context *rsc = RsdCpuReference::getTlsContext();
356    return rsrGetWidth(rsc);
357}
358
359static uint32_t SC_GetHeight() {
360    Context *rsc = RsdCpuReference::getTlsContext();
361    return rsrGetHeight(rsc);
362}
363
364static void SC_DrawTextAlloc(Allocation *a, int x, int y) {
365    Context *rsc = RsdCpuReference::getTlsContext();
366    rsrDrawTextAlloc(rsc, a, x, y);
367}
368
369static void SC_DrawText(const char *text, int x, int y) {
370    Context *rsc = RsdCpuReference::getTlsContext();
371    rsrDrawText(rsc, text, x, y);
372}
373
374static void SC_MeasureTextAlloc(Allocation *a,
375                         int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
376    Context *rsc = RsdCpuReference::getTlsContext();
377    rsrMeasureTextAlloc(rsc, a, left, right, top, bottom);
378}
379
380static void SC_MeasureText(const char *text,
381                    int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
382    Context *rsc = RsdCpuReference::getTlsContext();
383    rsrMeasureText(rsc, text, left, right, top, bottom);
384}
385
386static void SC_BindFont(Font *f) {
387    Context *rsc = RsdCpuReference::getTlsContext();
388    rsrBindFont(rsc, f);
389}
390
391static void SC_FontColor(float r, float g, float b, float a) {
392    Context *rsc = RsdCpuReference::getTlsContext();
393    rsrFontColor(rsc, r, g, b, a);
394}
395
396
397
398//////////////////////////////////////////////////////////////////////////////
399//
400//////////////////////////////////////////////////////////////////////////////
401
402static void SC_SetObject(ObjectBase **dst, ObjectBase * src) {
403    Context *rsc = RsdCpuReference::getTlsContext();
404    rsrSetObject(rsc, dst, src);
405}
406
407static void SC_ClearObject(ObjectBase **dst) {
408    Context *rsc = RsdCpuReference::getTlsContext();
409    rsrClearObject(rsc, dst);
410}
411
412static bool SC_IsObject(const ObjectBase *src) {
413    Context *rsc = RsdCpuReference::getTlsContext();
414    return rsrIsObject(rsc, src);
415}
416
417
418
419
420static const Allocation * SC_GetAllocation(const void *ptr) {
421    Context *rsc = RsdCpuReference::getTlsContext();
422    const Script *sc = RsdCpuReference::getTlsScript();
423    return rsdScriptGetAllocationForPointer(rsc, sc, ptr);
424}
425
426static void SC_ForEach_SAA(Script *target,
427                            Allocation *in,
428                            Allocation *out) {
429    Context *rsc = RsdCpuReference::getTlsContext();
430    rsrForEach(rsc, target, in, out, NULL, 0, NULL);
431}
432
433static void SC_ForEach_SAAU(Script *target,
434                            Allocation *in,
435                            Allocation *out,
436                            const void *usr) {
437    Context *rsc = RsdCpuReference::getTlsContext();
438    rsrForEach(rsc, target, in, out, usr, 0, NULL);
439}
440
441static void SC_ForEach_SAAUS(Script *target,
442                             Allocation *in,
443                             Allocation *out,
444                             const void *usr,
445                             const RsScriptCall *call) {
446    Context *rsc = RsdCpuReference::getTlsContext();
447    rsrForEach(rsc, target, in, out, usr, 0, call);
448}
449
450static void SC_ForEach_SAAUL(Script *target,
451                             Allocation *in,
452                             Allocation *out,
453                             const void *usr,
454                             uint32_t usrLen) {
455    Context *rsc = RsdCpuReference::getTlsContext();
456    rsrForEach(rsc, target, in, out, usr, usrLen, NULL);
457}
458
459static void SC_ForEach_SAAULS(Script *target,
460                              Allocation *in,
461                              Allocation *out,
462                              const void *usr,
463                              uint32_t usrLen,
464                              const RsScriptCall *call) {
465    Context *rsc = RsdCpuReference::getTlsContext();
466    rsrForEach(rsc, target, in, out, usr, usrLen, call);
467}
468
469
470
471//////////////////////////////////////////////////////////////////////////////
472// Time routines
473//////////////////////////////////////////////////////////////////////////////
474
475static float SC_GetDt() {
476    Context *rsc = RsdCpuReference::getTlsContext();
477    const Script *sc = RsdCpuReference::getTlsScript();
478    return rsrGetDt(rsc, sc);
479}
480
481time_t SC_Time(time_t *timer) {
482    Context *rsc = RsdCpuReference::getTlsContext();
483    return rsrTime(rsc, timer);
484}
485
486tm* SC_LocalTime(tm *local, time_t *timer) {
487    Context *rsc = RsdCpuReference::getTlsContext();
488    return rsrLocalTime(rsc, local, timer);
489}
490
491int64_t SC_UptimeMillis() {
492    Context *rsc = RsdCpuReference::getTlsContext();
493    return rsrUptimeMillis(rsc);
494}
495
496int64_t SC_UptimeNanos() {
497    Context *rsc = RsdCpuReference::getTlsContext();
498    return rsrUptimeNanos(rsc);
499}
500
501//////////////////////////////////////////////////////////////////////////////
502// Message routines
503//////////////////////////////////////////////////////////////////////////////
504
505static uint32_t SC_ToClient2(int cmdID, void *data, int len) {
506    Context *rsc = RsdCpuReference::getTlsContext();
507    return rsrToClient(rsc, cmdID, data, len);
508}
509
510static uint32_t SC_ToClient(int cmdID) {
511    Context *rsc = RsdCpuReference::getTlsContext();
512    return rsrToClient(rsc, cmdID, NULL, 0);
513}
514
515static uint32_t SC_ToClientBlocking2(int cmdID, void *data, int len) {
516    Context *rsc = RsdCpuReference::getTlsContext();
517    return rsrToClientBlocking(rsc, cmdID, data, len);
518}
519
520static uint32_t SC_ToClientBlocking(int cmdID) {
521    Context *rsc = RsdCpuReference::getTlsContext();
522    return rsrToClientBlocking(rsc, cmdID, NULL, 0);
523}
524
525
526static void * ElementAt1D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x) {
527    Context *rsc = RsdCpuReference::getTlsContext();
528    const Type *t = a->getType();
529    const Element *e = t->getElement();
530
531    char buf[256];
532    if (x >= t->getLODDimX(0)) {
533        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
534        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
535        return NULL;
536    }
537
538    if (vecSize != e->getVectorSize()) {
539        sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
540        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
541        return NULL;
542    }
543
544    if (dt != e->getType()) {
545        sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
546        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
547        return NULL;
548    }
549
550    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
551    const uint32_t eSize = e->getSizeBytes();
552    return &p[(eSize * x)];
553}
554
555static void * ElementAt2D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y) {
556    Context *rsc = RsdCpuReference::getTlsContext();
557    const Type *t = a->getType();
558    const Element *e = t->getElement();
559
560    char buf[256];
561    if (x >= t->getLODDimX(0)) {
562        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
563        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
564        return NULL;
565    }
566
567    if (y >= t->getLODDimY(0)) {
568        sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
569        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
570        return NULL;
571    }
572
573    if (vecSize != e->getVectorSize()) {
574        sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
575        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
576        return NULL;
577    }
578
579    if (dt != e->getType()) {
580        sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
581        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
582        return NULL;
583    }
584
585    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
586    const uint32_t eSize = e->getSizeBytes();
587    const uint32_t stride = a->mHal.drvState.lod[0].stride;
588    return &p[(eSize * x) + (y * stride)];
589}
590
591static void * ElementAt3D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y, uint32_t z) {
592    Context *rsc = RsdCpuReference::getTlsContext();
593    const Type *t = a->getType();
594    const Element *e = t->getElement();
595
596    char buf[256];
597    if (x >= t->getLODDimX(0)) {
598        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
599        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
600        return NULL;
601    }
602
603    if (y >= t->getLODDimY(0)) {
604        sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
605        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
606        return NULL;
607    }
608
609    if (z >= t->getLODDimZ(0)) {
610        sprintf(buf, "Out range ElementAt Z %i of %i", z, t->getLODDimZ(0));
611        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
612        return NULL;
613    }
614
615    if (vecSize != e->getVectorSize()) {
616        sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
617        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
618        return NULL;
619    }
620
621    if (dt != e->getType()) {
622        sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
623        rsc->setError(RS_ERROR_FATAL_UNKNOWN, buf);
624        return NULL;
625    }
626
627    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
628    const uint32_t eSize = e->getSizeBytes();
629    const uint32_t stride = a->mHal.drvState.lod[0].stride;
630    return &p[(eSize * x) + (y * stride)];
631}
632
633#define ELEMENT_AT(T, DT, VS)                                               \
634    static void SC_SetElementAt1_##T(Allocation *a, T val, uint32_t x) {           \
635        void *r = ElementAt1D(a, DT, VS, x);                            \
636        if (r != NULL) ((T *)r)[0] = val;                               \
637        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
638    }                                                                   \
639    static void SC_SetElementAt2_##T(Allocation * a, T val, uint32_t x, uint32_t y) { \
640        void *r = ElementAt2D(a, DT, VS, x, y);            \
641        if (r != NULL) ((T *)r)[0] = val;                               \
642        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
643    }                                                                   \
644    static void SC_SetElementAt3_##T(Allocation * a, T val, uint32_t x, uint32_t y, uint32_t z) { \
645        void *r = ElementAt3D(a, DT, VS, x, y, z);         \
646        if (r != NULL) ((T *)r)[0] = val;                               \
647        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
648    }                                                                   \
649    static T SC_GetElementAt1_##T(Allocation * a, uint32_t x) {                  \
650        void *r = ElementAt1D(a, DT, VS, x);               \
651        if (r != NULL) return ((T *)r)[0];                              \
652        ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
653        return 0;                                                       \
654    }                                                                   \
655    static T SC_GetElementAt2_##T(Allocation * a, uint32_t x, uint32_t y) {      \
656        void *r = ElementAt2D(a, DT, VS, x, y);            \
657        if (r != NULL) return ((T *)r)[0];                              \
658        ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
659        return 0;                                                       \
660    }                                                                   \
661    static T SC_GetElementAt3_##T(Allocation * a, uint32_t x, uint32_t y, uint32_t z) { \
662        void *r = ElementAt3D(a, DT, VS, x, y, z);         \
663        if (r != NULL) return ((T *)r)[0];                              \
664        ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
665        return 0;                                                       \
666    }
667
668ELEMENT_AT(char, RS_TYPE_SIGNED_8, 1)
669ELEMENT_AT(char2, RS_TYPE_SIGNED_8, 2)
670ELEMENT_AT(char3, RS_TYPE_SIGNED_8, 3)
671ELEMENT_AT(char4, RS_TYPE_SIGNED_8, 4)
672ELEMENT_AT(uchar, RS_TYPE_UNSIGNED_8, 1)
673ELEMENT_AT(uchar2, RS_TYPE_UNSIGNED_8, 2)
674ELEMENT_AT(uchar3, RS_TYPE_UNSIGNED_8, 3)
675ELEMENT_AT(uchar4, RS_TYPE_UNSIGNED_8, 4)
676ELEMENT_AT(short, RS_TYPE_SIGNED_16, 1)
677ELEMENT_AT(short2, RS_TYPE_SIGNED_16, 2)
678ELEMENT_AT(short3, RS_TYPE_SIGNED_16, 3)
679ELEMENT_AT(short4, RS_TYPE_SIGNED_16, 4)
680ELEMENT_AT(ushort, RS_TYPE_UNSIGNED_16, 1)
681ELEMENT_AT(ushort2, RS_TYPE_UNSIGNED_16, 2)
682ELEMENT_AT(ushort3, RS_TYPE_UNSIGNED_16, 3)
683ELEMENT_AT(ushort4, RS_TYPE_UNSIGNED_16, 4)
684ELEMENT_AT(int, RS_TYPE_SIGNED_32, 1)
685ELEMENT_AT(int2, RS_TYPE_SIGNED_32, 2)
686ELEMENT_AT(int3, RS_TYPE_SIGNED_32, 3)
687ELEMENT_AT(int4, RS_TYPE_SIGNED_32, 4)
688ELEMENT_AT(uint, RS_TYPE_UNSIGNED_32, 1)
689ELEMENT_AT(uint2, RS_TYPE_UNSIGNED_32, 2)
690ELEMENT_AT(uint3, RS_TYPE_UNSIGNED_32, 3)
691ELEMENT_AT(uint4, RS_TYPE_UNSIGNED_32, 4)
692ELEMENT_AT(long, RS_TYPE_SIGNED_64, 1)
693ELEMENT_AT(long2, RS_TYPE_SIGNED_64, 2)
694ELEMENT_AT(long3, RS_TYPE_SIGNED_64, 3)
695ELEMENT_AT(long4, RS_TYPE_SIGNED_64, 4)
696ELEMENT_AT(ulong, RS_TYPE_UNSIGNED_64, 1)
697ELEMENT_AT(ulong2, RS_TYPE_UNSIGNED_64, 2)
698ELEMENT_AT(ulong3, RS_TYPE_UNSIGNED_64, 3)
699ELEMENT_AT(ulong4, RS_TYPE_UNSIGNED_64, 4)
700ELEMENT_AT(float, RS_TYPE_FLOAT_32, 1)
701ELEMENT_AT(float2, RS_TYPE_FLOAT_32, 2)
702ELEMENT_AT(float3, RS_TYPE_FLOAT_32, 3)
703ELEMENT_AT(float4, RS_TYPE_FLOAT_32, 4)
704ELEMENT_AT(double, RS_TYPE_FLOAT_64, 1)
705ELEMENT_AT(double2, RS_TYPE_FLOAT_64, 2)
706ELEMENT_AT(double3, RS_TYPE_FLOAT_64, 3)
707ELEMENT_AT(double4, RS_TYPE_FLOAT_64, 4)
708
709#undef ELEMENT_AT
710
711//////////////////////////////////////////////////////////////////////////////
712// Stub implementation
713//////////////////////////////////////////////////////////////////////////////
714
715// llvm name mangling ref
716//  <builtin-type> ::= v  # void
717//                 ::= b  # bool
718//                 ::= c  # char
719//                 ::= a  # signed char
720//                 ::= h  # unsigned char
721//                 ::= s  # short
722//                 ::= t  # unsigned short
723//                 ::= i  # int
724//                 ::= j  # unsigned int
725//                 ::= l  # long
726//                 ::= m  # unsigned long
727//                 ::= x  # long long, __int64
728//                 ::= y  # unsigned long long, __int64
729//                 ::= f  # float
730//                 ::= d  # double
731
732static RsdCpuReference::CpuSymbol gSyms[] = {
733    // Debug runtime
734    { "_Z20rsGetElementAt_uchar13rs_allocationcj", (void *)&SC_GetElementAt1_uchar, true },
735    { "_Z21rsGetElementAt_uchar213rs_allocationj", (void *)&SC_GetElementAt1_uchar2, true },
736    { "_Z21rsGetElementAt_uchar313rs_allocationj", (void *)&SC_GetElementAt1_uchar3, true },
737    { "_Z21rsGetElementAt_uchar413rs_allocationj", (void *)&SC_GetElementAt1_uchar4, true },
738    { "_Z20rsGetElementAt_uchar13rs_allocationjj", (void *)&SC_GetElementAt2_uchar, true },
739    { "_Z21rsGetElementAt_uchar213rs_allocationjj", (void *)&SC_GetElementAt2_uchar2, true },
740    { "_Z21rsGetElementAt_uchar313rs_allocationjj", (void *)&SC_GetElementAt2_uchar3, true },
741    { "_Z21rsGetElementAt_uchar413rs_allocationjj", (void *)&SC_GetElementAt2_uchar4, true },
742    { "_Z20rsGetElementAt_uchar13rs_allocationjjj", (void *)&SC_GetElementAt3_uchar, true },
743    { "_Z21rsGetElementAt_uchar213rs_allocationjjj", (void *)&SC_GetElementAt3_uchar2, true },
744    { "_Z21rsGetElementAt_uchar313rs_allocationjjj", (void *)&SC_GetElementAt3_uchar3, true },
745    { "_Z21rsGetElementAt_uchar413rs_allocationjjj", (void *)&SC_GetElementAt3_uchar4, true },
746
747    { "_Z19rsGetElementAt_char13rs_allocationj", (void *)&SC_GetElementAt1_char, true },
748    { "_Z20rsGetElementAt_char213rs_allocationj", (void *)&SC_GetElementAt1_char2, true },
749    { "_Z20rsGetElementAt_char313rs_allocationj", (void *)&SC_GetElementAt1_char3, true },
750    { "_Z20rsGetElementAt_char413rs_allocationj", (void *)&SC_GetElementAt1_char4, true },
751    { "_Z19rsGetElementAt_char13rs_allocationjj", (void *)&SC_GetElementAt2_char, true },
752    { "_Z20rsGetElementAt_char213rs_allocationjj", (void *)&SC_GetElementAt2_char2, true },
753    { "_Z20rsGetElementAt_char313rs_allocationjj", (void *)&SC_GetElementAt2_char3, true },
754    { "_Z20rsGetElementAt_char413rs_allocationjj", (void *)&SC_GetElementAt2_char4, true },
755    { "_Z19rsGetElementAt_char13rs_allocationjjj", (void *)&SC_GetElementAt3_char, true },
756    { "_Z20rsGetElementAt_char213rs_allocationjjj", (void *)&SC_GetElementAt3_char2, true },
757    { "_Z20rsGetElementAt_char313rs_allocationjjj", (void *)&SC_GetElementAt3_char3, true },
758    { "_Z20rsGetElementAt_char413rs_allocationjjj", (void *)&SC_GetElementAt3_char4, true },
759
760    { "_Z21rsGetElementAt_ushort13rs_allocationcj", (void *)&SC_GetElementAt1_ushort, true },
761    { "_Z22rsGetElementAt_ushort213rs_allocationj", (void *)&SC_GetElementAt1_ushort2, true },
762    { "_Z22rsGetElementAt_ushort313rs_allocationj", (void *)&SC_GetElementAt1_ushort3, true },
763    { "_Z22rsGetElementAt_ushort413rs_allocationj", (void *)&SC_GetElementAt1_ushort4, true },
764    { "_Z21rsGetElementAt_ushort13rs_allocationjj", (void *)&SC_GetElementAt2_ushort, true },
765    { "_Z22rsGetElementAt_ushort213rs_allocationjj", (void *)&SC_GetElementAt2_ushort2, true },
766    { "_Z22rsGetElementAt_ushort313rs_allocationjj", (void *)&SC_GetElementAt2_ushort3, true },
767    { "_Z22rsGetElementAt_ushort413rs_allocationjj", (void *)&SC_GetElementAt2_ushort4, true },
768    { "_Z21rsGetElementAt_ushort13rs_allocationjjj", (void *)&SC_GetElementAt3_ushort, true },
769    { "_Z22rsGetElementAt_ushort213rs_allocationjjj", (void *)&SC_GetElementAt3_ushort2, true },
770    { "_Z22rsGetElementAt_ushort313rs_allocationjjj", (void *)&SC_GetElementAt3_ushort3, true },
771    { "_Z22rsGetElementAt_ushort413rs_allocationjjj", (void *)&SC_GetElementAt3_ushort4, true },
772
773    { "_Z20rsGetElementAt_short13rs_allocationj", (void *)&SC_GetElementAt1_short, true },
774    { "_Z21rsGetElementAt_short213rs_allocationj", (void *)&SC_GetElementAt1_short2, true },
775    { "_Z21rsGetElementAt_short313rs_allocationj", (void *)&SC_GetElementAt1_short3, true },
776    { "_Z21rsGetElementAt_short413rs_allocationj", (void *)&SC_GetElementAt1_short4, true },
777    { "_Z20rsGetElementAt_short13rs_allocationjj", (void *)&SC_GetElementAt2_short, true },
778    { "_Z21rsGetElementAt_short213rs_allocationjj", (void *)&SC_GetElementAt2_short2, true },
779    { "_Z21rsGetElementAt_short313rs_allocationjj", (void *)&SC_GetElementAt2_short3, true },
780    { "_Z21rsGetElementAt_short413rs_allocationjj", (void *)&SC_GetElementAt2_short4, true },
781    { "_Z20rsGetElementAt_short13rs_allocationjjj", (void *)&SC_GetElementAt3_short, true },
782    { "_Z21rsGetElementAt_short213rs_allocationjjj", (void *)&SC_GetElementAt3_short2, true },
783    { "_Z21rsGetElementAt_short313rs_allocationjjj", (void *)&SC_GetElementAt3_short3, true },
784    { "_Z21rsGetElementAt_short413rs_allocationjjj", (void *)&SC_GetElementAt3_short4, true },
785
786    { "_Z19rsGetElementAt_uint13rs_allocationcj", (void *)&SC_GetElementAt1_uint, true },
787    { "_Z20rsGetElementAt_uint213rs_allocationj", (void *)&SC_GetElementAt1_uint2, true },
788    { "_Z20rsGetElementAt_uint313rs_allocationj", (void *)&SC_GetElementAt1_uint3, true },
789    { "_Z20rsGetElementAt_uint413rs_allocationj", (void *)&SC_GetElementAt1_uint4, true },
790    { "_Z19rsGetElementAt_uint13rs_allocationjj", (void *)&SC_GetElementAt2_uint, true },
791    { "_Z20rsGetElementAt_uint213rs_allocationjj", (void *)&SC_GetElementAt2_uint2, true },
792    { "_Z20rsGetElementAt_uint313rs_allocationjj", (void *)&SC_GetElementAt2_uint3, true },
793    { "_Z20rsGetElementAt_uint413rs_allocationjj", (void *)&SC_GetElementAt2_uint4, true },
794    { "_Z19rsGetElementAt_uint13rs_allocationjjj", (void *)&SC_GetElementAt3_uint, true },
795    { "_Z20rsGetElementAt_uint213rs_allocationjjj", (void *)&SC_GetElementAt3_uint2, true },
796    { "_Z20rsGetElementAt_uint313rs_allocationjjj", (void *)&SC_GetElementAt3_uint3, true },
797    { "_Z20rsGetElementAt_uint413rs_allocationjjj", (void *)&SC_GetElementAt3_uint4, true },
798
799    { "_Z18rsGetElementAt_int13rs_allocationj", (void *)&SC_GetElementAt1_int, true },
800    { "_Z19rsGetElementAt_int213rs_allocationj", (void *)&SC_GetElementAt1_int2, true },
801    { "_Z19rsGetElementAt_int313rs_allocationj", (void *)&SC_GetElementAt1_int3, true },
802    { "_Z19rsGetElementAt_int413rs_allocationj", (void *)&SC_GetElementAt1_int4, true },
803    { "_Z18rsGetElementAt_int13rs_allocationjj", (void *)&SC_GetElementAt2_int, true },
804    { "_Z19rsGetElementAt_int213rs_allocationjj", (void *)&SC_GetElementAt2_int2, true },
805    { "_Z19rsGetElementAt_int313rs_allocationjj", (void *)&SC_GetElementAt2_int3, true },
806    { "_Z19rsGetElementAt_int413rs_allocationjj", (void *)&SC_GetElementAt2_int4, true },
807    { "_Z18rsGetElementAt_int13rs_allocationjjj", (void *)&SC_GetElementAt3_int, true },
808    { "_Z19rsGetElementAt_int213rs_allocationjjj", (void *)&SC_GetElementAt3_int2, true },
809    { "_Z19rsGetElementAt_int313rs_allocationjjj", (void *)&SC_GetElementAt3_int3, true },
810    { "_Z19rsGetElementAt_int413rs_allocationjjj", (void *)&SC_GetElementAt3_int4, true },
811
812    { "_Z20rsGetElementAt_ulong13rs_allocationcj", (void *)&SC_GetElementAt1_ulong, true },
813    { "_Z21rsGetElementAt_ulong213rs_allocationj", (void *)&SC_GetElementAt1_ulong2, true },
814    { "_Z21rsGetElementAt_ulong313rs_allocationj", (void *)&SC_GetElementAt1_ulong3, true },
815    { "_Z21rsGetElementAt_ulong413rs_allocationj", (void *)&SC_GetElementAt1_ulong4, true },
816    { "_Z20rsGetElementAt_ulong13rs_allocationjj", (void *)&SC_GetElementAt2_ulong, true },
817    { "_Z21rsGetElementAt_ulong213rs_allocationjj", (void *)&SC_GetElementAt2_ulong2, true },
818    { "_Z21rsGetElementAt_ulong313rs_allocationjj", (void *)&SC_GetElementAt2_ulong3, true },
819    { "_Z21rsGetElementAt_ulong413rs_allocationjj", (void *)&SC_GetElementAt2_ulong4, true },
820    { "_Z20rsGetElementAt_ulong13rs_allocationjjj", (void *)&SC_GetElementAt3_ulong, true },
821    { "_Z21rsGetElementAt_ulong213rs_allocationjjj", (void *)&SC_GetElementAt3_ulong2, true },
822    { "_Z21rsGetElementAt_ulong313rs_allocationjjj", (void *)&SC_GetElementAt3_ulong3, true },
823    { "_Z21rsGetElementAt_ulong413rs_allocationjjj", (void *)&SC_GetElementAt3_ulong4, true },
824
825    { "_Z19rsGetElementAt_long13rs_allocationj", (void *)&SC_GetElementAt1_long, true },
826    { "_Z20rsGetElementAt_long213rs_allocationj", (void *)&SC_GetElementAt1_long2, true },
827    { "_Z20rsGetElementAt_long313rs_allocationj", (void *)&SC_GetElementAt1_long3, true },
828    { "_Z20rsGetElementAt_long413rs_allocationj", (void *)&SC_GetElementAt1_long4, true },
829    { "_Z19rsGetElementAt_long13rs_allocationjj", (void *)&SC_GetElementAt2_long, true },
830    { "_Z20rsGetElementAt_long213rs_allocationjj", (void *)&SC_GetElementAt2_long2, true },
831    { "_Z20rsGetElementAt_long313rs_allocationjj", (void *)&SC_GetElementAt2_long3, true },
832    { "_Z20rsGetElementAt_long413rs_allocationjj", (void *)&SC_GetElementAt2_long4, true },
833    { "_Z19rsGetElementAt_long13rs_allocationjjj", (void *)&SC_GetElementAt3_long, true },
834    { "_Z20rsGetElementAt_long213rs_allocationjjj", (void *)&SC_GetElementAt3_long2, true },
835    { "_Z20rsGetElementAt_long313rs_allocationjjj", (void *)&SC_GetElementAt3_long3, true },
836    { "_Z20rsGetElementAt_long413rs_allocationjjj", (void *)&SC_GetElementAt3_long4, true },
837
838    { "_Z20rsGetElementAt_float13rs_allocationcj", (void *)&SC_GetElementAt1_float, true },
839    { "_Z21rsGetElementAt_float213rs_allocationj", (void *)&SC_GetElementAt1_float2, true },
840    { "_Z21rsGetElementAt_float313rs_allocationj", (void *)&SC_GetElementAt1_float3, true },
841    { "_Z21rsGetElementAt_float413rs_allocationj", (void *)&SC_GetElementAt1_float4, true },
842    { "_Z20rsGetElementAt_float13rs_allocationjj", (void *)&SC_GetElementAt2_float, true },
843    { "_Z21rsGetElementAt_float213rs_allocationjj", (void *)&SC_GetElementAt2_float2, true },
844    { "_Z21rsGetElementAt_float313rs_allocationjj", (void *)&SC_GetElementAt2_float3, true },
845    { "_Z21rsGetElementAt_float413rs_allocationjj", (void *)&SC_GetElementAt2_float4, true },
846    { "_Z20rsGetElementAt_float13rs_allocationjjj", (void *)&SC_GetElementAt3_float, true },
847    { "_Z21rsGetElementAt_float213rs_allocationjjj", (void *)&SC_GetElementAt3_float2, true },
848    { "_Z21rsGetElementAt_float313rs_allocationjjj", (void *)&SC_GetElementAt3_float3, true },
849    { "_Z21rsGetElementAt_float413rs_allocationjjj", (void *)&SC_GetElementAt3_float4, true },
850
851    { "_Z21rsGetElementAt_double13rs_allocationcj", (void *)&SC_GetElementAt1_double, true },
852    { "_Z22rsGetElementAt_double213rs_allocationj", (void *)&SC_GetElementAt1_double2, true },
853    { "_Z22rsGetElementAt_double313rs_allocationj", (void *)&SC_GetElementAt1_double3, true },
854    { "_Z22rsGetElementAt_double413rs_allocationj", (void *)&SC_GetElementAt1_double4, true },
855    { "_Z21rsGetElementAt_double13rs_allocationjj", (void *)&SC_GetElementAt2_double, true },
856    { "_Z22rsGetElementAt_double213rs_allocationjj", (void *)&SC_GetElementAt2_double2, true },
857    { "_Z22rsGetElementAt_double313rs_allocationjj", (void *)&SC_GetElementAt2_double3, true },
858    { "_Z22rsGetElementAt_double413rs_allocationjj", (void *)&SC_GetElementAt2_double4, true },
859    { "_Z21rsGetElementAt_double13rs_allocationjjj", (void *)&SC_GetElementAt3_double, true },
860    { "_Z22rsGetElementAt_double213rs_allocationjjj", (void *)&SC_GetElementAt3_double2, true },
861    { "_Z22rsGetElementAt_double313rs_allocationjjj", (void *)&SC_GetElementAt3_double3, true },
862    { "_Z22rsGetElementAt_double413rs_allocationjjj", (void *)&SC_GetElementAt3_double4, true },
863
864
865
866    { "_Z20rsSetElementAt_uchar13rs_allocationhj", (void *)&SC_SetElementAt1_uchar, true },
867    { "_Z21rsSetElementAt_uchar213rs_allocationDv2_hj", (void *)&SC_SetElementAt1_uchar2, true },
868    { "_Z21rsSetElementAt_uchar313rs_allocationDv3_hj", (void *)&SC_SetElementAt1_uchar3, true },
869    { "_Z21rsSetElementAt_uchar413rs_allocationDv4_hj", (void *)&SC_SetElementAt1_uchar4, true },
870    { "_Z20rsSetElementAt_uchar13rs_allocationhjj", (void *)&SC_SetElementAt2_uchar, true },
871    { "_Z21rsSetElementAt_uchar213rs_allocationDv2_hjj", (void *)&SC_SetElementAt2_uchar2, true },
872    { "_Z21rsSetElementAt_uchar313rs_allocationDv3_hjj", (void *)&SC_SetElementAt2_uchar3, true },
873    { "_Z21rsSetElementAt_uchar413rs_allocationDv4_hjj", (void *)&SC_SetElementAt2_uchar4, true },
874    { "_Z20rsSetElementAt_uchar13rs_allocationhjjj", (void *)&SC_SetElementAt3_uchar, true },
875    { "_Z21rsSetElementAt_uchar213rs_allocationDv2_hjjj", (void *)&SC_SetElementAt3_uchar2, true },
876    { "_Z21rsSetElementAt_uchar313rs_allocationDv3_hjjj", (void *)&SC_SetElementAt3_uchar3, true },
877    { "_Z21rsSetElementAt_uchar413rs_allocationDv4_hjjj", (void *)&SC_SetElementAt3_uchar4, true },
878
879    { "_Z19rsSetElementAt_char13rs_allocationcj", (void *)&SC_SetElementAt1_char, true },
880    { "_Z20rsSetElementAt_char213rs_allocationDv2_cj", (void *)&SC_SetElementAt1_char2, true },
881    { "_Z20rsSetElementAt_char313rs_allocationDv3_cj", (void *)&SC_SetElementAt1_char3, true },
882    { "_Z20rsSetElementAt_char413rs_allocationDv4_cj", (void *)&SC_SetElementAt1_char4, true },
883    { "_Z19rsSetElementAt_char13rs_allocationcjj", (void *)&SC_SetElementAt2_char, true },
884    { "_Z20rsSetElementAt_char213rs_allocationDv2_cjj", (void *)&SC_SetElementAt2_char2, true },
885    { "_Z20rsSetElementAt_char313rs_allocationDv3_cjj", (void *)&SC_SetElementAt2_char3, true },
886    { "_Z20rsSetElementAt_char413rs_allocationDv4_cjj", (void *)&SC_SetElementAt2_char4, true },
887    { "_Z19rsSetElementAt_char13rs_allocationcjjj", (void *)&SC_SetElementAt3_char, true },
888    { "_Z20rsSetElementAt_char213rs_allocationDv2_cjjj", (void *)&SC_SetElementAt3_char2, true },
889    { "_Z20rsSetElementAt_char313rs_allocationDv3_cjjj", (void *)&SC_SetElementAt3_char3, true },
890    { "_Z20rsSetElementAt_char413rs_allocationDv4_cjjj", (void *)&SC_SetElementAt3_char4, true },
891
892    { "_Z21rsSetElementAt_ushort13rs_allocationht", (void *)&SC_SetElementAt1_ushort, true },
893    { "_Z22rsSetElementAt_ushort213rs_allocationDv2_tj", (void *)&SC_SetElementAt1_ushort2, true },
894    { "_Z22rsSetElementAt_ushort313rs_allocationDv3_tj", (void *)&SC_SetElementAt1_ushort3, true },
895    { "_Z22rsSetElementAt_ushort413rs_allocationDv4_tj", (void *)&SC_SetElementAt1_ushort4, true },
896    { "_Z21rsSetElementAt_ushort13rs_allocationtjj", (void *)&SC_SetElementAt2_ushort, true },
897    { "_Z22rsSetElementAt_ushort213rs_allocationDv2_tjj", (void *)&SC_SetElementAt2_ushort2, true },
898    { "_Z22rsSetElementAt_ushort313rs_allocationDv3_tjj", (void *)&SC_SetElementAt2_ushort3, true },
899    { "_Z22rsSetElementAt_ushort413rs_allocationDv4_tjj", (void *)&SC_SetElementAt2_ushort4, true },
900    { "_Z21rsSetElementAt_ushort13rs_allocationtjjj", (void *)&SC_SetElementAt3_ushort, true },
901    { "_Z22rsSetElementAt_ushort213rs_allocationDv2_tjjj", (void *)&SC_SetElementAt3_ushort2, true },
902    { "_Z22rsSetElementAt_ushort313rs_allocationDv3_tjjj", (void *)&SC_SetElementAt3_ushort3, true },
903    { "_Z22rsSetElementAt_ushort413rs_allocationDv4_tjjj", (void *)&SC_SetElementAt3_ushort4, true },
904
905    { "_Z20rsSetElementAt_short13rs_allocationsj", (void *)&SC_SetElementAt1_short, true },
906    { "_Z21rsSetElementAt_short213rs_allocationDv2_sj", (void *)&SC_SetElementAt1_short2, true },
907    { "_Z21rsSetElementAt_short313rs_allocationDv3_sj", (void *)&SC_SetElementAt1_short3, true },
908    { "_Z21rsSetElementAt_short413rs_allocationDv4_sj", (void *)&SC_SetElementAt1_short4, true },
909    { "_Z20rsSetElementAt_short13rs_allocationsjj", (void *)&SC_SetElementAt2_short, true },
910    { "_Z21rsSetElementAt_short213rs_allocationDv2_sjj", (void *)&SC_SetElementAt2_short2, true },
911    { "_Z21rsSetElementAt_short313rs_allocationDv3_sjj", (void *)&SC_SetElementAt2_short3, true },
912    { "_Z21rsSetElementAt_short413rs_allocationDv4_sjj", (void *)&SC_SetElementAt2_short4, true },
913    { "_Z20rsSetElementAt_short13rs_allocationsjjj", (void *)&SC_SetElementAt3_short, true },
914    { "_Z21rsSetElementAt_short213rs_allocationDv2_sjjj", (void *)&SC_SetElementAt3_short2, true },
915    { "_Z21rsSetElementAt_short313rs_allocationDv3_sjjj", (void *)&SC_SetElementAt3_short3, true },
916    { "_Z21rsSetElementAt_short413rs_allocationDv4_sjjj", (void *)&SC_SetElementAt3_short4, true },
917
918    { "_Z19rsSetElementAt_uint13rs_allocationjj", (void *)&SC_SetElementAt1_uint, true },
919    { "_Z20rsSetElementAt_uint213rs_allocationDv2_jj", (void *)&SC_SetElementAt1_uint2, true },
920    { "_Z20rsSetElementAt_uint313rs_allocationDv3_jj", (void *)&SC_SetElementAt1_uint3, true },
921    { "_Z20rsSetElementAt_uint413rs_allocationDv4_jj", (void *)&SC_SetElementAt1_uint4, true },
922    { "_Z19rsSetElementAt_uint13rs_allocationjjj", (void *)&SC_SetElementAt2_uint, true },
923    { "_Z20rsSetElementAt_uint213rs_allocationDv2_jjj", (void *)&SC_SetElementAt2_uint2, true },
924    { "_Z20rsSetElementAt_uint313rs_allocationDv3_jjj", (void *)&SC_SetElementAt2_uint3, true },
925    { "_Z20rsSetElementAt_uint413rs_allocationDv4_jjj", (void *)&SC_SetElementAt2_uint4, true },
926    { "_Z19rsSetElementAt_uint13rs_allocationjjjj", (void *)&SC_SetElementAt3_uint, true },
927    { "_Z20rsSetElementAt_uint213rs_allocationDv2_jjjj", (void *)&SC_SetElementAt3_uint2, true },
928    { "_Z20rsSetElementAt_uint313rs_allocationDv3_jjjj", (void *)&SC_SetElementAt3_uint3, true },
929    { "_Z20rsSetElementAt_uint413rs_allocationDv4_jjjj", (void *)&SC_SetElementAt3_uint4, true },
930
931    { "_Z19rsSetElementAt_int13rs_allocationij", (void *)&SC_SetElementAt1_int, true },
932    { "_Z19rsSetElementAt_int213rs_allocationDv2_ij", (void *)&SC_SetElementAt1_int2, true },
933    { "_Z19rsSetElementAt_int313rs_allocationDv3_ij", (void *)&SC_SetElementAt1_int3, true },
934    { "_Z19rsSetElementAt_int413rs_allocationDv4_ij", (void *)&SC_SetElementAt1_int4, true },
935    { "_Z18rsSetElementAt_int13rs_allocationijj", (void *)&SC_SetElementAt2_int, true },
936    { "_Z19rsSetElementAt_int213rs_allocationDv2_ijj", (void *)&SC_SetElementAt2_int2, true },
937    { "_Z19rsSetElementAt_int313rs_allocationDv3_ijj", (void *)&SC_SetElementAt2_int3, true },
938    { "_Z19rsSetElementAt_int413rs_allocationDv4_ijj", (void *)&SC_SetElementAt2_int4, true },
939    { "_Z18rsSetElementAt_int13rs_allocationijjj", (void *)&SC_SetElementAt3_int, true },
940    { "_Z19rsSetElementAt_int213rs_allocationDv2_ijjj", (void *)&SC_SetElementAt3_int2, true },
941    { "_Z19rsSetElementAt_int313rs_allocationDv3_ijjj", (void *)&SC_SetElementAt3_int3, true },
942    { "_Z19rsSetElementAt_int413rs_allocationDv4_ijjj", (void *)&SC_SetElementAt3_int4, true },
943
944    { "_Z20rsSetElementAt_ulong13rs_allocationmt", (void *)&SC_SetElementAt1_ulong, true },
945    { "_Z21rsSetElementAt_ulong213rs_allocationDv2_mj", (void *)&SC_SetElementAt1_ulong2, true },
946    { "_Z21rsSetElementAt_ulong313rs_allocationDv3_mj", (void *)&SC_SetElementAt1_ulong3, true },
947    { "_Z21rsSetElementAt_ulong413rs_allocationDv4_mj", (void *)&SC_SetElementAt1_ulong4, true },
948    { "_Z20rsSetElementAt_ulong13rs_allocationmjj", (void *)&SC_SetElementAt2_ulong, true },
949    { "_Z21rsSetElementAt_ulong213rs_allocationDv2_mjj", (void *)&SC_SetElementAt2_ulong2, true },
950    { "_Z21rsSetElementAt_ulong313rs_allocationDv3_mjj", (void *)&SC_SetElementAt2_ulong3, true },
951    { "_Z21rsSetElementAt_ulong413rs_allocationDv4_mjj", (void *)&SC_SetElementAt2_ulong4, true },
952    { "_Z20rsSetElementAt_ulong13rs_allocationmjjj", (void *)&SC_SetElementAt3_ulong, true },
953    { "_Z21rsSetElementAt_ulong213rs_allocationDv2_mjjj", (void *)&SC_SetElementAt3_ulong2, true },
954    { "_Z21rsSetElementAt_ulong313rs_allocationDv3_mjjj", (void *)&SC_SetElementAt3_ulong3, true },
955    { "_Z21rsSetElementAt_ulong413rs_allocationDv4_mjjj", (void *)&SC_SetElementAt3_ulong4, true },
956
957    { "_Z19rsSetElementAt_long13rs_allocationlj", (void *)&SC_SetElementAt1_long, true },
958    { "_Z20rsSetElementAt_long213rs_allocationDv2_lj", (void *)&SC_SetElementAt1_long2, true },
959    { "_Z20rsSetElementAt_long313rs_allocationDv3_lj", (void *)&SC_SetElementAt1_long3, true },
960    { "_Z20rsSetElementAt_long413rs_allocationDv4_lj", (void *)&SC_SetElementAt1_long4, true },
961    { "_Z19rsSetElementAt_long13rs_allocationljj", (void *)&SC_SetElementAt2_long, true },
962    { "_Z20rsSetElementAt_long213rs_allocationDv2_ljj", (void *)&SC_SetElementAt2_long2, true },
963    { "_Z20rsSetElementAt_long313rs_allocationDv3_ljj", (void *)&SC_SetElementAt2_long3, true },
964    { "_Z20rsSetElementAt_long413rs_allocationDv4_ljj", (void *)&SC_SetElementAt2_long4, true },
965    { "_Z19rsSetElementAt_long13rs_allocationljjj", (void *)&SC_SetElementAt3_long, true },
966    { "_Z20rsSetElementAt_long213rs_allocationDv2_ljjj", (void *)&SC_SetElementAt3_long2, true },
967    { "_Z20rsSetElementAt_long313rs_allocationDv3_ljjj", (void *)&SC_SetElementAt3_long3, true },
968    { "_Z20rsSetElementAt_long413rs_allocationDv4_ljjj", (void *)&SC_SetElementAt3_long4, true },
969
970    { "_Z20rsSetElementAt_float13rs_allocationft", (void *)&SC_SetElementAt1_float, true },
971    { "_Z21rsSetElementAt_float213rs_allocationDv2_fj", (void *)&SC_SetElementAt1_float2, true },
972    { "_Z21rsSetElementAt_float313rs_allocationDv3_fj", (void *)&SC_SetElementAt1_float3, true },
973    { "_Z21rsSetElementAt_float413rs_allocationDv4_fj", (void *)&SC_SetElementAt1_float4, true },
974    { "_Z20rsSetElementAt_float13rs_allocationfjj", (void *)&SC_SetElementAt2_float, true },
975    { "_Z21rsSetElementAt_float213rs_allocationDv2_fjj", (void *)&SC_SetElementAt2_float2, true },
976    { "_Z21rsSetElementAt_float313rs_allocationDv3_fjj", (void *)&SC_SetElementAt2_float3, true },
977    { "_Z21rsSetElementAt_float413rs_allocationDv4_fjj", (void *)&SC_SetElementAt2_float4, true },
978    { "_Z20rsSetElementAt_float13rs_allocationfjjj", (void *)&SC_SetElementAt3_float, true },
979    { "_Z21rsSetElementAt_float213rs_allocationDv2_fjjj", (void *)&SC_SetElementAt3_float2, true },
980    { "_Z21rsSetElementAt_float313rs_allocationDv3_fjjj", (void *)&SC_SetElementAt3_float3, true },
981    { "_Z21rsSetElementAt_float413rs_allocationDv4_fjjj", (void *)&SC_SetElementAt3_float4, true },
982
983    { "_Z21rsSetElementAt_double13rs_allocationdt", (void *)&SC_SetElementAt1_double, true },
984    { "_Z22rsSetElementAt_double213rs_allocationDv2_dj", (void *)&SC_SetElementAt1_double2, true },
985    { "_Z22rsSetElementAt_double313rs_allocationDv3_dj", (void *)&SC_SetElementAt1_double3, true },
986    { "_Z22rsSetElementAt_double413rs_allocationDv4_dj", (void *)&SC_SetElementAt1_double4, true },
987    { "_Z21rsSetElementAt_double13rs_allocationdjj", (void *)&SC_SetElementAt2_double, true },
988    { "_Z22rsSetElementAt_double213rs_allocationDv2_djj", (void *)&SC_SetElementAt2_double2, true },
989    { "_Z22rsSetElementAt_double313rs_allocationDv3_djj", (void *)&SC_SetElementAt2_double3, true },
990    { "_Z22rsSetElementAt_double413rs_allocationDv4_djj", (void *)&SC_SetElementAt2_double4, true },
991    { "_Z21rsSetElementAt_double13rs_allocationdjjj", (void *)&SC_SetElementAt3_double, true },
992    { "_Z22rsSetElementAt_double213rs_allocationDv2_djjj", (void *)&SC_SetElementAt3_double2, true },
993    { "_Z22rsSetElementAt_double313rs_allocationDv3_djjj", (void *)&SC_SetElementAt3_double3, true },
994    { "_Z22rsSetElementAt_double413rs_allocationDv4_djjj", (void *)&SC_SetElementAt3_double4, true },
995
996
997    // Refcounting
998    { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject, true },
999    { "_Z13rsClearObjectP10rs_element", (void *)&SC_ClearObject, true },
1000    { "_Z10rsIsObject10rs_element", (void *)&SC_IsObject, true },
1001
1002    { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject, true },
1003    { "_Z13rsClearObjectP7rs_type", (void *)&SC_ClearObject, true },
1004    { "_Z10rsIsObject7rs_type", (void *)&SC_IsObject, true },
1005
1006    { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject, true },
1007    { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_ClearObject, true },
1008    { "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject, true },
1009
1010    { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject, true },
1011    { "_Z13rsClearObjectP10rs_sampler", (void *)&SC_ClearObject, true },
1012    { "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject, true },
1013
1014    { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject, true },
1015    { "_Z13rsClearObjectP9rs_script", (void *)&SC_ClearObject, true },
1016    { "_Z10rsIsObject9rs_script", (void *)&SC_IsObject, true },
1017
1018    { "_Z11rsSetObjectP7rs_pathS_", (void *)&SC_SetObject, true },
1019    { "_Z13rsClearObjectP7rs_path", (void *)&SC_ClearObject, true },
1020    { "_Z10rsIsObject7rs_path", (void *)&SC_IsObject, true },
1021
1022    { "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_SetObject, true },
1023    { "_Z13rsClearObjectP7rs_mesh", (void *)&SC_ClearObject, true },
1024    { "_Z10rsIsObject7rs_mesh", (void *)&SC_IsObject, true },
1025
1026    { "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_SetObject, true },
1027    { "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_ClearObject, true },
1028    { "_Z10rsIsObject19rs_program_fragment", (void *)&SC_IsObject, true },
1029
1030    { "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_SetObject, true },
1031    { "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_ClearObject, true },
1032    { "_Z10rsIsObject17rs_program_vertex", (void *)&SC_IsObject, true },
1033
1034    { "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_SetObject, true },
1035    { "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_ClearObject, true },
1036    { "_Z10rsIsObject17rs_program_raster", (void *)&SC_IsObject, true },
1037
1038    { "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_SetObject, true },
1039    { "_Z13rsClearObjectP16rs_program_store", (void *)&SC_ClearObject, true },
1040    { "_Z10rsIsObject16rs_program_store", (void *)&SC_IsObject, true },
1041
1042    { "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_SetObject, true },
1043    { "_Z13rsClearObjectP7rs_font", (void *)&SC_ClearObject, true },
1044    { "_Z10rsIsObject7rs_font", (void *)&SC_IsObject, true },
1045
1046    // Allocation ops
1047    { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_AllocationSyncAll, true },
1048    { "_Z20rsgAllocationSyncAll13rs_allocation", (void *)&SC_AllocationSyncAll, false },
1049    { "_Z20rsgAllocationSyncAll13rs_allocationj", (void *)&SC_AllocationSyncAll2, false },
1050    { "_Z20rsgAllocationSyncAll13rs_allocation24rs_allocation_usage_type", (void *)&SC_AllocationSyncAll2, false },
1051    { "_Z15rsGetAllocationPKv", (void *)&SC_GetAllocation, true },
1052    { "_Z18rsAllocationIoSend13rs_allocation", (void *)&SC_AllocationIoSend, false },
1053    { "_Z21rsAllocationIoReceive13rs_allocation", (void *)&SC_AllocationIoReceive, false },
1054    { "_Z23rsAllocationCopy1DRange13rs_allocationjjjS_jj", (void *)&SC_AllocationCopy1DRange, false },
1055    { "_Z23rsAllocationCopy2DRange13rs_allocationjjj26rs_allocation_cubemap_facejjS_jjjS0_", (void *)&SC_AllocationCopy2DRange, false },
1056
1057    // Messaging
1058
1059    { "_Z14rsSendToClienti", (void *)&SC_ToClient, false },
1060    { "_Z14rsSendToClientiPKvj", (void *)&SC_ToClient2, false },
1061    { "_Z22rsSendToClientBlockingi", (void *)&SC_ToClientBlocking, false },
1062    { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_ToClientBlocking2, false },
1063
1064    { "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_BindProgramFragment, false },
1065    { "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_BindProgramStore, false },
1066    { "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_BindProgramVertex, false },
1067    { "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_BindProgramRaster, false },
1068    { "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_BindSampler, false },
1069    { "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_BindTexture, false },
1070    { "_Z15rsgBindConstant19rs_program_fragmentj13rs_allocation", (void *)&SC_BindFragmentConstant, false },
1071    { "_Z15rsgBindConstant17rs_program_vertexj13rs_allocation", (void *)&SC_BindVertexConstant, false },
1072
1073    { "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadProjectionMatrix, false },
1074    { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadModelMatrix, false },
1075    { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadTextureMatrix, false },
1076
1077    { "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_VpGetProjectionMatrix, false },
1078
1079    { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_PfConstantColor, false },
1080
1081    { "_Z11rsgGetWidthv", (void *)&SC_GetWidth, false },
1082    { "_Z12rsgGetHeightv", (void *)&SC_GetHeight, false },
1083
1084
1085    { "_Z11rsgDrawRectfffff", (void *)&SC_DrawRect, false },
1086    { "_Z11rsgDrawQuadffffffffffff", (void *)&SC_DrawQuad, false },
1087    { "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_DrawQuadTexCoords, false },
1088    { "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_DrawSpriteScreenspace, false },
1089
1090    { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_DrawMesh, false },
1091    { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_DrawMeshPrimitive, false },
1092    { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_DrawMeshPrimitiveRange, false },
1093    { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_MeshComputeBoundingBox, false },
1094
1095    { "_Z11rsgDrawPath7rs_path", (void *)&SC_DrawPath, false },
1096
1097    { "_Z13rsgClearColorffff", (void *)&SC_ClearColor, false },
1098    { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth, false },
1099
1100    { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText, false },
1101    { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc, false },
1102    { "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText, false },
1103    { "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc, false },
1104
1105    { "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont, false },
1106    { "_Z12rsgFontColorffff", (void *)&SC_FontColor, false },
1107
1108    { "_Z18rsgBindColorTarget13rs_allocationj", (void *)&SC_BindFrameBufferObjectColorTarget, false },
1109    { "_Z18rsgBindDepthTarget13rs_allocation", (void *)&SC_BindFrameBufferObjectDepthTarget, false },
1110    { "_Z19rsgClearColorTargetj", (void *)&SC_ClearFrameBufferObjectColorTarget, false },
1111    { "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false },
1112    { "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false },
1113
1114    { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, true },
1115    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, true },
1116    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK14rs_script_call", (void *)&SC_ForEach_SAAUS, true },
1117    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, true },
1118    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK14rs_script_call", (void *)&SC_ForEach_SAAULS, true },
1119
1120    // time
1121    { "_Z6rsTimePi", (void *)&SC_Time, true },
1122    { "_Z11rsLocaltimeP5rs_tmPKi", (void *)&SC_LocalTime, true },
1123    { "_Z14rsUptimeMillisv", (void*)&SC_UptimeMillis, true },
1124    { "_Z13rsUptimeNanosv", (void*)&SC_UptimeNanos, true },
1125    { "_Z7rsGetDtv", (void*)&SC_GetDt, false },
1126
1127    // misc
1128    { "_Z5colorffff", (void *)&SC_Color, false },
1129    { "_Z9rsgFinishv", (void *)&SC_Finish, false },
1130
1131    { NULL, NULL, false }
1132};
1133
1134
1135extern const RsdCpuReference::CpuSymbol * rsdLookupRuntimeStub(Context * pContext, char const* name) {
1136    ScriptC *s = (ScriptC *)pContext;
1137    const RsdCpuReference::CpuSymbol *syms = gSyms;
1138    const RsdCpuReference::CpuSymbol *sym = NULL;
1139
1140    if (!sym) {
1141        while (syms->fnPtr) {
1142            if (!strcmp(syms->name, name)) {
1143                return syms;
1144            }
1145            syms++;
1146        }
1147    }
1148
1149    return NULL;
1150}
1151
1152
1153