rsdRuntimeStubs.cpp revision a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121b
187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams/*
2709a0978ae141198018ca9769f8d96292a8928e6Jason Sams * Copyright (C) 2011-2012 The Android Open Source Project
387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams *
487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * Licensed under the Apache License, Version 2.0 (the "License");
587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * you may not use this file except in compliance with the License.
687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * You may obtain a copy of the License at
787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams *
887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams *      http://www.apache.org/licenses/LICENSE-2.0
987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams *
1087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * Unless required by applicable law or agreed to in writing, software
1187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * distributed under the License is distributed on an "AS IS" BASIS,
1287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * See the License for the specific language governing permissions and
1487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams * limitations under the License.
1587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams */
1687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
1787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsContext.h"
1887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsScriptC.h"
1987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsMatrix4x4.h"
2087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsMatrix3x3.h"
2187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsMatrix2x2.h"
2287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsRuntime.h"
2387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
2487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include "rsdCore.h"
25807fdc4b6f3fb893015ee136565d6151bb2332d3Jason Sams#include "rsdBcc.h"
2687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
279e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams#include "rsdPath.h"
28b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams#include "rsdAllocation.h"
29414a46166126da6864258bd25ff183f9a3c6261dStephen Hines#include "rsdShaderCache.h"
30414a46166126da6864258bd25ff183f9a3c6261dStephen Hines#include "rsdVertexArray.h"
3187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
3287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams#include <time.h>
3387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
3487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsusing namespace android;
3587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsusing namespace android::renderscript;
3687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
37a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef float float2 __attribute__((ext_vector_type(2)));
38a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef float float3 __attribute__((ext_vector_type(3)));
39a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef float float4 __attribute__((ext_vector_type(4)));
405261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef double double2 __attribute__((ext_vector_type(2)));
415261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef double double3 __attribute__((ext_vector_type(3)));
425261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef double double4 __attribute__((ext_vector_type(4)));
43a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef char char2 __attribute__((ext_vector_type(2)));
44a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef char char3 __attribute__((ext_vector_type(3)));
45a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef char char4 __attribute__((ext_vector_type(4)));
46a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned char uchar2 __attribute__((ext_vector_type(2)));
47a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned char uchar3 __attribute__((ext_vector_type(3)));
48a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned char uchar4 __attribute__((ext_vector_type(4)));
49a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef short short2 __attribute__((ext_vector_type(2)));
50a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef short short3 __attribute__((ext_vector_type(3)));
51a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef short short4 __attribute__((ext_vector_type(4)));
52a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned short ushort2 __attribute__((ext_vector_type(2)));
53a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned short ushort3 __attribute__((ext_vector_type(3)));
54a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned short ushort4 __attribute__((ext_vector_type(4)));
55a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef int32_t int2 __attribute__((ext_vector_type(2)));
56a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef int32_t int3 __attribute__((ext_vector_type(3)));
57a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef int32_t int4 __attribute__((ext_vector_type(4)));
58a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef uint32_t uint2 __attribute__((ext_vector_type(2)));
59a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef uint32_t uint3 __attribute__((ext_vector_type(3)));
60a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef uint32_t uint4 __attribute__((ext_vector_type(4)));
61a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef long long long2 __attribute__((ext_vector_type(2)));
62a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef long long long3 __attribute__((ext_vector_type(3)));
63a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef long long long4 __attribute__((ext_vector_type(4)));
64a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned long long ulong2 __attribute__((ext_vector_type(2)));
65a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned long long ulong3 __attribute__((ext_vector_type(3)));
66a1dd74c5ce4db0991020a4836be24fc35af4f301Rajeev Sharmatypedef unsigned long long ulong4 __attribute__((ext_vector_type(4)));
6787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
685261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef uint8_t uchar;
695261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef uint16_t ushort;
705261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef uint32_t uint;
710b575de8ed0b628d84d256f5846500b0385979bdTim Murray#ifndef RS_SERVER
725261a5ea546ff358edd5aac7602fc4132434f481Jason Samstypedef uint64_t ulong;
730b575de8ed0b628d84d256f5846500b0385979bdTim Murray#endif
7487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
75d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#ifdef RS_COMPATIBILITY_LIB
76d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#define OPAQUETYPE(t) \
77d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    typedef struct { const int* const p; } __attribute__((packed, aligned(4))) t;
78d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
79d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_element)
80d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_type)
81d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_allocation)
82d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_sampler)
83d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_script)
84d6f1f46b2929ed56c73ba32357cde31b82972fbeTim MurrayOPAQUETYPE(rs_script_call)
85d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#undef OPAQUETYPE
86d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
877a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hinestypedef enum {
887a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines    // Empty to avoid conflicting definitions with RsAllocationCubemapFace
897a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines} rs_allocation_cubemap_face;
907a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
91d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murraytypedef struct {
92d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_sec;     ///< seconds
93d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_min;     ///< minutes
94d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_hour;    ///< hours
95d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_mday;    ///< day of the month
96d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_mon;     ///< month
97d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_year;    ///< year
98d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_wday;    ///< day of the week
99d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_yday;    ///< day of the year
100d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    int tm_isdst;   ///< daylight savings time
101d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray} rs_tm;
102d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#endif
103d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
10487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
10587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Allocation
10687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
10787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
10887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
10987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_AllocationSyncAll2(Allocation *a, RsAllocationUsageType source) {
110709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
111709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrAllocationSyncAll(rsc, a, source);
11287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
11387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
11487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_AllocationSyncAll(Allocation *a) {
115709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
116709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrAllocationSyncAll(rsc, a, RS_ALLOCATION_USAGE_SCRIPT);
11787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
11887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
11974a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchoukstatic void SC_AllocationCopy1DRange(Allocation *dstAlloc,
12074a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t dstOff,
12174a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t dstMip,
12274a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t count,
12374a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     Allocation *srcAlloc,
12474a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t srcOff, uint32_t srcMip) {
125709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
126a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk    rsrAllocationCopy1DRange(rsc, dstAlloc, dstOff, dstMip, count,
127a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk                             srcAlloc, srcOff, srcMip);
12874a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk}
12974a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk
13074a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchoukstatic void SC_AllocationCopy2DRange(Allocation *dstAlloc,
13174a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t dstXoff, uint32_t dstYoff,
13274a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t dstMip, uint32_t dstFace,
13374a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t width, uint32_t height,
13474a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     Allocation *srcAlloc,
13574a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t srcXoff, uint32_t srcYoff,
13674a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk                                     uint32_t srcMip, uint32_t srcFace) {
137709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
138a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk    rsrAllocationCopy2DRange(rsc, dstAlloc,
139a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk                             dstXoff, dstYoff, dstMip, dstFace,
140a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk                             width, height,
141a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk                             srcAlloc,
142a94952436aeb251f587c1bccdf94c7f75285dfe2Alex Sakhartchouk                             srcXoff, srcYoff, srcMip, srcFace);
14374a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk}
14474a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk
145b322033c13487a174bb9c26466e9684d1ff4de8dJason Samsstatic void SC_AllocationIoSend(Allocation *alloc) {
146709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
147ddceab9a001f07a3395226c5e06e3b420720af0fJason Sams    rsrAllocationIoSend(rsc, alloc);
148b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams}
149b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams
150b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams
151b322033c13487a174bb9c26466e9684d1ff4de8dJason Samsstatic void SC_AllocationIoReceive(Allocation *alloc) {
152709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
153ddceab9a001f07a3395226c5e06e3b420720af0fJason Sams    rsrAllocationIoReceive(rsc, alloc);
154b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams}
155b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams
1567a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines#ifndef RS_COMPATIBILITY_LIB
15774a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk
15887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
15987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Context
16087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
16187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
16287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindTexture(ProgramFragment *pf, uint32_t slot, Allocation *a) {
163709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
164709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindTexture(rsc, pf, slot, a);
16587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
16687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
167a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchoukstatic void SC_BindVertexConstant(ProgramVertex *pv, uint32_t slot, Allocation *a) {
168709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
169709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindConstant(rsc, pv, slot, a);
170a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk}
171a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk
172a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchoukstatic void SC_BindFragmentConstant(ProgramFragment *pf, uint32_t slot, Allocation *a) {
173709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
174709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindConstant(rsc, pf, slot, a);
175a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk}
176a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk
17787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindSampler(ProgramFragment *pf, uint32_t slot, Sampler *s) {
178709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
179709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindSampler(rsc, pf, slot, s);
18087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
18187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
18287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindProgramStore(ProgramStore *ps) {
183709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
184709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindProgramStore(rsc, ps);
18587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
18687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
18787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindProgramFragment(ProgramFragment *pf) {
188709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
189709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindProgramFragment(rsc, pf);
19087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
19187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
19287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindProgramVertex(ProgramVertex *pv) {
193709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
194709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindProgramVertex(rsc, pv);
19587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
19687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
19787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindProgramRaster(ProgramRaster *pr) {
198709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
199709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindProgramRaster(rsc, pr);
20087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
20187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
20287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindFrameBufferObjectColorTarget(Allocation *a, uint32_t slot) {
203709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
204709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindFrameBufferObjectColorTarget(rsc, a, slot);
20587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
20687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
20787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindFrameBufferObjectDepthTarget(Allocation *a) {
208709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
209709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindFrameBufferObjectDepthTarget(rsc, a);
21087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
21187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
21287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearFrameBufferObjectColorTarget(uint32_t slot) {
213709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
214709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrClearFrameBufferObjectColorTarget(rsc, slot);
21587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
21687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
21787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearFrameBufferObjectDepthTarget(Context *, Script *) {
218709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
219709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrClearFrameBufferObjectDepthTarget(rsc);
22087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
22187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
22287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearFrameBufferObjectTargets(Context *, Script *) {
223709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
224709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrClearFrameBufferObjectTargets(rsc);
22587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
22687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
22787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
22887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
22987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// VP
23087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
23187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
23287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_VpLoadProjectionMatrix(const rsc_Matrix *m) {
233709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
234709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrVpLoadProjectionMatrix(rsc, m);
23587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
23687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
23787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_VpLoadModelMatrix(const rsc_Matrix *m) {
238709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
239709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrVpLoadModelMatrix(rsc, m);
24087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
24187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
24287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_VpLoadTextureMatrix(const rsc_Matrix *m) {
243709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
244709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrVpLoadTextureMatrix(rsc, m);
24587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
24687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
24787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_PfConstantColor(ProgramFragment *pf, float r, float g, float b, float a) {
248709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
249709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrPfConstantColor(rsc, pf, r, g, b, a);
25087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
25187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
25287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_VpGetProjectionMatrix(rsc_Matrix *m) {
253709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
254709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrVpGetProjectionMatrix(rsc, m);
25587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
25687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
25787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
25887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
25987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Drawing
26087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
26187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
26287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
26387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                                 float x2, float y2, float z2, float u2, float v2,
26487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                                 float x3, float y3, float z3, float u3, float v3,
26587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                                 float x4, float y4, float z4, float u4, float v4) {
266709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
267414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
268414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    if (!rsc->setupCheck()) {
269414a46166126da6864258bd25ff183f9a3c6261dStephen Hines        return;
270414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    }
271414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
272414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    RsdHal *dc = (RsdHal *)rsc->mHal.drv;
273414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    if (!dc->gl.shaderCache->setup(rsc)) {
274414a46166126da6864258bd25ff183f9a3c6261dStephen Hines        return;
275414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    }
276414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
277414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //ALOGE("Quad");
278414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1);
279414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2);
280414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3);
281414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4);
282414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
283414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4};
284414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4};
285414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
286414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    RsdVertexArray::Attrib attribs[2];
287414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    attribs[0].set(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "ATTRIB_position");
288414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    attribs[1].set(GL_FLOAT, 2, 8, false, (uint32_t)tex, "ATTRIB_texture0");
289414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
290414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    RsdVertexArray va(attribs, 2);
291414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    va.setup(rsc);
292414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
293414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4);
29487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
29587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
29687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawQuad(float x1, float y1, float z1,
29787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                        float x2, float y2, float z2,
29887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                        float x3, float y3, float z3,
29987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                        float x4, float y4, float z4) {
300414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    SC_DrawQuadTexCoords(x1, y1, z1, 0, 1,
301414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                         x2, y2, z2, 1, 1,
302414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                         x3, y3, z3, 1, 0,
303414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                         x4, y4, z4, 0, 0);
30487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
30587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
30687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawSpriteScreenspace(float x, float y, float z, float w, float h) {
307709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
308414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
309414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex());
310414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    rsc->setProgramVertex(rsc->getDefaultProgramVertex());
311414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //rsc->setupCheck();
312414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
313414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    //GLint crop[4] = {0, h, w, -h};
314414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
315414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    float sh = rsc->getHeight();
316414a46166126da6864258bd25ff183f9a3c6261dStephen Hines
317414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    SC_DrawQuad(x,   sh - y,     z,
318414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                x+w, sh - y,     z,
319414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                x+w, sh - (y+h), z,
320414a46166126da6864258bd25ff183f9a3c6261dStephen Hines                x,   sh - (y+h), z);
321414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    rsc->setProgramVertex((ProgramVertex *)tmp.get());
32287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
32387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
32487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawRect(float x1, float y1, float x2, float y2, float z) {
325414a46166126da6864258bd25ff183f9a3c6261dStephen Hines    SC_DrawQuad(x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z);
32687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
32787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
3289e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Samsstatic void SC_DrawPath(Path *p) {
329709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
3309e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams    rsdPathDraw(rsc, p);
3319e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams}
3329e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams
33387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawMesh(Mesh *m) {
334709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
335709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrDrawMesh(rsc, m);
33687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
33787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
33887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawMeshPrimitive(Mesh *m, uint32_t primIndex) {
339709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
340709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrDrawMeshPrimitive(rsc, m, primIndex);
34187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
34287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
34387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawMeshPrimitiveRange(Mesh *m, uint32_t primIndex, uint32_t start, uint32_t len) {
344709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
345709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrDrawMeshPrimitiveRange(rsc, m, primIndex, start, len);
34687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
34787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
34887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_MeshComputeBoundingBox(Mesh *m,
34987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                               float *minX, float *minY, float *minZ,
35087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                               float *maxX, float *maxY, float *maxZ) {
351709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
352709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrMeshComputeBoundingBox(rsc, m, minX, minY, minZ, maxX, maxY, maxZ);
35387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
35487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
35587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
35687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
35787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
35887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//
35987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
36087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
36187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
36287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_Color(float r, float g, float b, float a) {
363709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
364709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrColor(rsc, r, g, b, a);
36587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
36687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
36787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_Finish() {
368709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
369653b53ebcd2bedc94ac486080d2e82e1920232e3Alex Sakhartchouk    rsdGLFinish(rsc);
37087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
37187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
37287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearColor(float r, float g, float b, float a) {
373709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
374709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrPrepareClear(rsc);
375653b53ebcd2bedc94ac486080d2e82e1920232e3Alex Sakhartchouk    rsdGLClearColor(rsc, r, g, b, a);
37687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
37787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
37887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearDepth(float v) {
379709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
380709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrPrepareClear(rsc);
381653b53ebcd2bedc94ac486080d2e82e1920232e3Alex Sakhartchouk    rsdGLClearDepth(rsc, v);
38287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
38387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
38487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic uint32_t SC_GetWidth() {
385709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
386709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrGetWidth(rsc);
38787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
38887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
38987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic uint32_t SC_GetHeight() {
390709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
391709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrGetHeight(rsc);
39287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
39387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
39487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawTextAlloc(Allocation *a, int x, int y) {
395709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
396709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrDrawTextAlloc(rsc, a, x, y);
39787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
39887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
39987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_DrawText(const char *text, int x, int y) {
400709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
401709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrDrawText(rsc, text, x, y);
40287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
40387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
40487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_MeasureTextAlloc(Allocation *a,
40587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                         int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
406709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
407709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrMeasureTextAlloc(rsc, a, left, right, top, bottom);
40887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
40987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
41087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_MeasureText(const char *text,
41187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams                    int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
412709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
413709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrMeasureText(rsc, text, left, right, top, bottom);
41487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
41587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
41687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_BindFont(Font *f) {
417709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
418709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrBindFont(rsc, f);
41987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
42087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
42187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_FontColor(float r, float g, float b, float a) {
422709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
423709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrFontColor(rsc, r, g, b, a);
42487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
425110f181b7966212a36ef18016f9b81c7322d0a2fJason Sams#endif
42687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
42787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
42887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
42987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//
43087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
43187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
43287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_SetObject(ObjectBase **dst, ObjectBase * src) {
433709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
434709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrSetObject(rsc, dst, src);
43587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
43687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
43787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic void SC_ClearObject(ObjectBase **dst) {
438709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
439709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrClearObject(rsc, dst);
44087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
44187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
44287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic bool SC_IsObject(const ObjectBase *src) {
443709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
444709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrIsObject(rsc, src);
44587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
44687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
44787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
44887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
44987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
45087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic const Allocation * SC_GetAllocation(const void *ptr) {
451709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
452709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    const Script *sc = RsdCpuReference::getTlsScript();
453807fdc4b6f3fb893015ee136565d6151bb2332d3Jason Sams    return rsdScriptGetAllocationForPointer(rsc, sc, ptr);
45487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
45587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
456c500e74d0848b721bf01cf0ab344a6adb035c312Jason Samsstatic void SC_ForEach_SAA(Script *target,
457c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                            Allocation *in,
458c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                            Allocation *out) {
459709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
460709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrForEach(rsc, target, in, out, NULL, 0, NULL);
461c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams}
462c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams
463c500e74d0848b721bf01cf0ab344a6adb035c312Jason Samsstatic void SC_ForEach_SAAU(Script *target,
464c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                            Allocation *in,
465c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                            Allocation *out,
466c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                            const void *usr) {
467709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
468709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrForEach(rsc, target, in, out, usr, 0, NULL);
46987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
47087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
471c500e74d0848b721bf01cf0ab344a6adb035c312Jason Samsstatic void SC_ForEach_SAAUS(Script *target,
472c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             Allocation *in,
473c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             Allocation *out,
474c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             const void *usr,
475c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             const RsScriptCall *call) {
476709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
477709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrForEach(rsc, target, in, out, usr, 0, call);
47887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
47987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
480c500e74d0848b721bf01cf0ab344a6adb035c312Jason Samsstatic void SC_ForEach_SAAUL(Script *target,
481c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             Allocation *in,
482c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             Allocation *out,
483c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             const void *usr,
484c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                             uint32_t usrLen) {
485709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
486709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrForEach(rsc, target, in, out, usr, usrLen, NULL);
487c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams}
488c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams
489c500e74d0848b721bf01cf0ab344a6adb035c312Jason Samsstatic void SC_ForEach_SAAULS(Script *target,
490c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                              Allocation *in,
491c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                              Allocation *out,
492c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                              const void *usr,
493c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                              uint32_t usrLen,
494c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams                              const RsScriptCall *call) {
495709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
496709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    rsrForEach(rsc, target, in, out, usr, usrLen, call);
497c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams}
498c500e74d0848b721bf01cf0ab344a6adb035c312Jason Sams
49987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
50087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
50187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
50287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Time routines
50387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
50487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
50587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic float SC_GetDt() {
506709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
507709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    const Script *sc = RsdCpuReference::getTlsScript();
50887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    return rsrGetDt(rsc, sc);
50987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
51087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
511d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#ifndef RS_COMPATIBILITY_LIB
51287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samstime_t SC_Time(time_t *timer) {
513709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
514709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrTime(rsc, timer);
51587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
516d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#else
517d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murraystatic int SC_Time(int *timer) {
518d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    Context *rsc = RsdCpuReference::getTlsContext();
519d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return rsrTime(rsc, (long*)timer);
520d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
521d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray#endif
52287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
52387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samstm* SC_LocalTime(tm *local, time_t *timer) {
524709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
525709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrLocalTime(rsc, local, timer);
52687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
52787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
52887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsint64_t SC_UptimeMillis() {
529709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
530709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrUptimeMillis(rsc);
53187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
53287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
53387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsint64_t SC_UptimeNanos() {
534709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
535709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrUptimeNanos(rsc);
53687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
53787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
53887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
53987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Message routines
54087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
54187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
542276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesstatic uint32_t SC_ToClient2(int cmdID, const void *data, uint32_t len) {
543709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
544709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrToClient(rsc, cmdID, data, len);
54587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
54687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
54787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic uint32_t SC_ToClient(int cmdID) {
548709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
54970537f52bdc6e8702db03cc91fe511371fb31267Stephen Hines    return rsrToClient(rsc, cmdID, (const void *)NULL, 0);
55087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
55187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
552276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesstatic uint32_t SC_ToClientBlocking2(int cmdID, const void *data, uint32_t len) {
553709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
554709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    return rsrToClientBlocking(rsc, cmdID, data, len);
55587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
55687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
55787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Samsstatic uint32_t SC_ToClientBlocking(int cmdID) {
558709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
55970537f52bdc6e8702db03cc91fe511371fb31267Stephen Hines    return rsrToClientBlocking(rsc, cmdID, (const void *)NULL, 0);
56087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
56187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
56287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
5635261a5ea546ff358edd5aac7602fc4132434f481Jason Samsstatic void * ElementAt1D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x) {
5645261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
5655261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Type *t = a->getType();
5665261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Element *e = t->getElement();
5675261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
5685261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    char buf[256];
5695261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (x >= t->getLODDimX(0)) {
5705261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
571cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
5725261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
5735261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
5745261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
575d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (vecSize > 0) {
576d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (vecSize != e->getVectorSize()) {
577d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
578cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
579d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
580d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
581d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
582d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (dt != e->getType()) {
583d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
584cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
585d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
586d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
5875261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
5885261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
5895261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
5905261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const uint32_t eSize = e->getSizeBytes();
5915261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    return &p[(eSize * x)];
5925261a5ea546ff358edd5aac7602fc4132434f481Jason Sams}
5935261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
5945261a5ea546ff358edd5aac7602fc4132434f481Jason Samsstatic void * ElementAt2D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y) {
5955261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
5965261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Type *t = a->getType();
5975261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Element *e = t->getElement();
5985261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
5995261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    char buf[256];
6005261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (x >= t->getLODDimX(0)) {
6015261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
602cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
6035261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
6045261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6055261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6065261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (y >= t->getLODDimY(0)) {
6075261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
608cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
6095261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
6105261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6115261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
612d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (vecSize > 0) {
613d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (vecSize != e->getVectorSize()) {
614d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
615cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
616d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
617d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
618d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
619d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (dt != e->getType()) {
620d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
621cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
622d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
623d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
6245261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6255261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6265261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
6275261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const uint32_t eSize = e->getSizeBytes();
6285261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const uint32_t stride = a->mHal.drvState.lod[0].stride;
6295261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    return &p[(eSize * x) + (y * stride)];
6305261a5ea546ff358edd5aac7602fc4132434f481Jason Sams}
6315261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6325261a5ea546ff358edd5aac7602fc4132434f481Jason Samsstatic void * ElementAt3D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y, uint32_t z) {
6335261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    Context *rsc = RsdCpuReference::getTlsContext();
6345261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Type *t = a->getType();
6355261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const Element *e = t->getElement();
6365261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6375261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    char buf[256];
6385261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (x >= t->getLODDimX(0)) {
6395261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
640cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
6415261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
6425261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6435261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6445261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (y >= t->getLODDimY(0)) {
6455261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
646cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
6475261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
6485261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6495261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6505261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    if (z >= t->getLODDimZ(0)) {
6515261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        sprintf(buf, "Out range ElementAt Z %i of %i", z, t->getLODDimZ(0));
652cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines        rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
6535261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        return NULL;
6545261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6555261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
656d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (vecSize > 0) {
657d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (vecSize != e->getVectorSize()) {
658d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
659cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
660d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
661d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
662d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
663d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (dt != e->getType()) {
664d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
665cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines            rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
666d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams            return NULL;
667d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        }
6685261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
6695261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
6705261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
6715261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const uint32_t eSize = e->getSizeBytes();
6725261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    const uint32_t stride = a->mHal.drvState.lod[0].stride;
6735261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    return &p[(eSize * x) + (y * stride)];
6745261a5ea546ff358edd5aac7602fc4132434f481Jason Sams}
6755261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
676d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic const void * SC_GetElementAt1D(Allocation *a, uint32_t x) {
677d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    return ElementAt1D(a, RS_TYPE_UNSIGNED_8, 0, x);
678d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
679d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic const void * SC_GetElementAt2D(Allocation *a, uint32_t x, uint32_t y) {
680d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    return ElementAt2D(a, RS_TYPE_UNSIGNED_8, 0, x, y);
681d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
682d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic const void * SC_GetElementAt3D(Allocation *a, uint32_t x, uint32_t y, uint32_t z) {
683d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    return ElementAt3D(a, RS_TYPE_UNSIGNED_8, 0, x, y, z);
684d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
685d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
686d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic void SC_SetElementAt1D(Allocation *a, const void *ptr, uint32_t x) {
687d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Type *t = a->getType();
688d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Element *e = t->getElement();
689d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    void *tmp = ElementAt1D(a, RS_TYPE_UNSIGNED_8, 0, x);
690d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (tmp != NULL) {
691d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        memcpy(tmp, ptr, e->getSizeBytes());
692d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    }
693d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
694d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic void SC_SetElementAt2D(Allocation *a, const void *ptr, uint32_t x, uint32_t y) {
695d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Type *t = a->getType();
696d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Element *e = t->getElement();
697d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    void *tmp = ElementAt2D(a, RS_TYPE_UNSIGNED_8, 0, x, y);
698d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (tmp != NULL) {
699d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        memcpy(tmp, ptr, e->getSizeBytes());
700d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    }
701d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
702d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Samsstatic void SC_SetElementAt3D(Allocation *a, const void *ptr, uint32_t x, uint32_t y, uint32_t z) {
703d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Type *t = a->getType();
704d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    const Element *e = t->getElement();
705d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    void *tmp = ElementAt3D(a, RS_TYPE_UNSIGNED_8, 0, x, y, z);
706d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    if (tmp != NULL) {
707d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        memcpy(tmp, ptr, e->getSizeBytes());
708d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    }
709d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams}
710d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
7115261a5ea546ff358edd5aac7602fc4132434f481Jason Sams#define ELEMENT_AT(T, DT, VS)                                               \
712d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_SetElementAt1_##T(Allocation *a, const T *val, uint32_t x) {           \
7135261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt1D(a, DT, VS, x);                            \
714d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) ((T *)r)[0] = *val;                               \
7155261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
7165261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }                                                                   \
717d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_SetElementAt2_##T(Allocation * a, const T * val, uint32_t x, uint32_t y) { \
7185261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt2D(a, DT, VS, x, y);            \
719d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) ((T *)r)[0] = *val;                               \
7205261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
7215261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }                                                                   \
722d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_SetElementAt3_##T(Allocation * a, const T * val, uint32_t x, uint32_t y, uint32_t z) { \
7235261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt3D(a, DT, VS, x, y, z);         \
724d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) ((T *)r)[0] = *val;                               \
7255261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);               \
7265261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }                                                                   \
727d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_GetElementAt1_##T(Allocation * a, T *val, uint32_t x) {                  \
7285261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt1D(a, DT, VS, x);               \
729d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) *val = ((T *)r)[0];                              \
730d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
7315261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }                                                                   \
732d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_GetElementAt2_##T(Allocation * a, T *val, uint32_t x, uint32_t y) {      \
7335261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt2D(a, DT, VS, x, y);            \
734d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) *val = ((T *)r)[0];                              \
735d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
7365261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }                                                                   \
737d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    static void SC_GetElementAt3_##T(Allocation * a, T *val, uint32_t x, uint32_t y, uint32_t z) { \
7385261a5ea546ff358edd5aac7602fc4132434f481Jason Sams        void *r = ElementAt3D(a, DT, VS, x, y, z);         \
739d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        if (r != NULL) *val = ((T *)r)[0];                              \
740d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams        else ALOGE("Error from %s", __PRETTY_FUNCTION__);                    \
7415261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    }
7425261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
7435261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(char, RS_TYPE_SIGNED_8, 1)
7445261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(char2, RS_TYPE_SIGNED_8, 2)
7455261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(char3, RS_TYPE_SIGNED_8, 3)
7465261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(char4, RS_TYPE_SIGNED_8, 4)
7475261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uchar, RS_TYPE_UNSIGNED_8, 1)
7485261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uchar2, RS_TYPE_UNSIGNED_8, 2)
7495261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uchar3, RS_TYPE_UNSIGNED_8, 3)
7505261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uchar4, RS_TYPE_UNSIGNED_8, 4)
7515261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(short, RS_TYPE_SIGNED_16, 1)
7525261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(short2, RS_TYPE_SIGNED_16, 2)
7535261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(short3, RS_TYPE_SIGNED_16, 3)
7545261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(short4, RS_TYPE_SIGNED_16, 4)
7555261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ushort, RS_TYPE_UNSIGNED_16, 1)
7565261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ushort2, RS_TYPE_UNSIGNED_16, 2)
7575261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ushort3, RS_TYPE_UNSIGNED_16, 3)
7585261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ushort4, RS_TYPE_UNSIGNED_16, 4)
7595261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(int, RS_TYPE_SIGNED_32, 1)
7605261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(int2, RS_TYPE_SIGNED_32, 2)
7615261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(int3, RS_TYPE_SIGNED_32, 3)
7625261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(int4, RS_TYPE_SIGNED_32, 4)
7635261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uint, RS_TYPE_UNSIGNED_32, 1)
7645261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uint2, RS_TYPE_UNSIGNED_32, 2)
7655261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uint3, RS_TYPE_UNSIGNED_32, 3)
7665261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(uint4, RS_TYPE_UNSIGNED_32, 4)
7675261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(long, RS_TYPE_SIGNED_64, 1)
7685261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(long2, RS_TYPE_SIGNED_64, 2)
7695261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(long3, RS_TYPE_SIGNED_64, 3)
7705261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(long4, RS_TYPE_SIGNED_64, 4)
7715261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ulong, RS_TYPE_UNSIGNED_64, 1)
7725261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ulong2, RS_TYPE_UNSIGNED_64, 2)
7735261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ulong3, RS_TYPE_UNSIGNED_64, 3)
7745261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(ulong4, RS_TYPE_UNSIGNED_64, 4)
7755261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(float, RS_TYPE_FLOAT_32, 1)
7765261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(float2, RS_TYPE_FLOAT_32, 2)
7775261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(float3, RS_TYPE_FLOAT_32, 3)
7785261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(float4, RS_TYPE_FLOAT_32, 4)
7795261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(double, RS_TYPE_FLOAT_64, 1)
7805261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(double2, RS_TYPE_FLOAT_64, 2)
7815261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(double3, RS_TYPE_FLOAT_64, 3)
7825261a5ea546ff358edd5aac7602fc4132434f481Jason SamsELEMENT_AT(double4, RS_TYPE_FLOAT_64, 4)
7835261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
7845261a5ea546ff358edd5aac7602fc4132434f481Jason Sams#undef ELEMENT_AT
78587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
78687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
78787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// Stub implementation
78887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//////////////////////////////////////////////////////////////////////////////
78987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
79087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams// llvm name mangling ref
79187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//  <builtin-type> ::= v  # void
79287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= b  # bool
79387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= c  # char
79487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= a  # signed char
79587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= h  # unsigned char
79687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= s  # short
79787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= t  # unsigned short
79887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= i  # int
79987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= j  # unsigned int
80087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= l  # long
80187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= m  # unsigned long
80287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= x  # long long, __int64
80387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= y  # unsigned long long, __int64
80487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= f  # float
80587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams//                 ::= d  # double
80687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
807709a0978ae141198018ca9769f8d96292a8928e6Jason Samsstatic RsdCpuReference::CpuSymbol gSyms[] = {
8085261a5ea546ff358edd5aac7602fc4132434f481Jason Sams    // Debug runtime
809d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_GetElementAt1D, true },
810d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_GetElementAt2D, true },
811d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_GetElementAt3D, true },
812d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsSetElementAt13rs_allocationPKvj", (void *)&SC_SetElementAt1D, true },
813d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsSetElementAt13rs_allocationPKvjj", (void *)&SC_SetElementAt2D, true },
814d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z14rsSetElementAt13rs_allocationPKvjjj", (void *)&SC_SetElementAt3D, true },
815d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
816d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
817d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uchar13rs_allocationPhj", (void *)&SC_GetElementAt1_uchar, true },
818d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hj", (void *)&SC_GetElementAt1_uchar2, true },
819d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hj", (void *)&SC_GetElementAt1_uchar3, true },
820d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hj", (void *)&SC_GetElementAt1_uchar4, true },
821d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uchar13rs_allocationPhjj", (void *)&SC_GetElementAt2_uchar, true },
822d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjj", (void *)&SC_GetElementAt2_uchar2, true },
823d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjj", (void *)&SC_GetElementAt2_uchar3, true },
824d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjj", (void *)&SC_GetElementAt2_uchar4, true },
825d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uchar13rs_allocationPhjjj", (void *)&SC_GetElementAt3_uchar, true },
826d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjjj", (void *)&SC_GetElementAt3_uchar2, true },
827d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjjj", (void *)&SC_GetElementAt3_uchar3, true },
828d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjjj", (void *)&SC_GetElementAt3_uchar4, true },
829d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
830d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_char13rs_allocationPcj", (void *)&SC_GetElementAt1_char, true },
831d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char213rs_allocationPDv2_cj", (void *)&SC_GetElementAt1_char2, true },
832d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char313rs_allocationPDv3_cj", (void *)&SC_GetElementAt1_char3, true },
833d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char413rs_allocationPDv4_cj", (void *)&SC_GetElementAt1_char4, true },
834d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_char13rs_allocationPcjj", (void *)&SC_GetElementAt2_char, true },
835d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char213rs_allocationPDv2_cjj", (void *)&SC_GetElementAt2_char2, true },
836d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char313rs_allocationPDv3_cjj", (void *)&SC_GetElementAt2_char3, true },
837d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char413rs_allocationPDv4_cjj", (void *)&SC_GetElementAt2_char4, true },
838d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_char13rs_allocationPcjjj", (void *)&SC_GetElementAt3_char, true },
839d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char213rs_allocationPDv2_cjjj", (void *)&SC_GetElementAt3_char2, true },
840d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char313rs_allocationPDv3_cjjj", (void *)&SC_GetElementAt3_char3, true },
841d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_char413rs_allocationPDv4_cjjj", (void *)&SC_GetElementAt3_char4, true },
842d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
843d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ushort13rs_allocationPtj", (void *)&SC_GetElementAt1_ushort, true },
844d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tj", (void *)&SC_GetElementAt1_ushort2, true },
845d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tj", (void *)&SC_GetElementAt1_ushort3, true },
846d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tj", (void *)&SC_GetElementAt1_ushort4, true },
847d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ushort13rs_allocationPtjj", (void *)&SC_GetElementAt2_ushort, true },
848d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjj", (void *)&SC_GetElementAt2_ushort2, true },
849d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjj", (void *)&SC_GetElementAt2_ushort3, true },
850d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjj", (void *)&SC_GetElementAt2_ushort4, true },
851d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ushort13rs_allocationPtjjj", (void *)&SC_GetElementAt3_ushort, true },
852d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjjj", (void *)&SC_GetElementAt3_ushort2, true },
853d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjjj", (void *)&SC_GetElementAt3_ushort3, true },
854d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjjj", (void *)&SC_GetElementAt3_ushort4, true },
855d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
856d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_short13rs_allocationPsj", (void *)&SC_GetElementAt1_short, true },
857d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short213rs_allocationPDv2_sj", (void *)&SC_GetElementAt1_short2, true },
858d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short313rs_allocationPDv3_sj", (void *)&SC_GetElementAt1_short3, true },
859d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short413rs_allocationPDv4_sj", (void *)&SC_GetElementAt1_short4, true },
860d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_short13rs_allocationPsjj", (void *)&SC_GetElementAt2_short, true },
861d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short213rs_allocationPDv2_sjj", (void *)&SC_GetElementAt2_short2, true },
862d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short313rs_allocationPDv3_sjj", (void *)&SC_GetElementAt2_short3, true },
863d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short413rs_allocationPDv4_sjj", (void *)&SC_GetElementAt2_short4, true },
864d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_short13rs_allocationPsjjj", (void *)&SC_GetElementAt3_short, true },
865d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short213rs_allocationPDv2_sjjj", (void *)&SC_GetElementAt3_short2, true },
866d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short313rs_allocationPDv3_sjjj", (void *)&SC_GetElementAt3_short3, true },
867d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_short413rs_allocationPDv4_sjjj", (void *)&SC_GetElementAt3_short4, true },
868d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
869d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_uint13rs_allocationPjj", (void *)&SC_GetElementAt1_uint, true },
870d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jj", (void *)&SC_GetElementAt1_uint2, true },
871d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jj", (void *)&SC_GetElementAt1_uint3, true },
872d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jj", (void *)&SC_GetElementAt1_uint4, true },
873d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_uint13rs_allocationPjjj", (void *)&SC_GetElementAt2_uint, true },
874d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjj", (void *)&SC_GetElementAt2_uint2, true },
875d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjj", (void *)&SC_GetElementAt2_uint3, true },
876d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjj", (void *)&SC_GetElementAt2_uint4, true },
877d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_uint13rs_allocationPjjjj", (void *)&SC_GetElementAt3_uint, true },
878d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjjj", (void *)&SC_GetElementAt3_uint2, true },
879d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjjj", (void *)&SC_GetElementAt3_uint3, true },
880d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjjj", (void *)&SC_GetElementAt3_uint4, true },
881d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
882d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z18rsGetElementAt_int13rs_allocationPij", (void *)&SC_GetElementAt1_int, true },
883d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int213rs_allocationPDv2_ij", (void *)&SC_GetElementAt1_int2, true },
884d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int313rs_allocationPDv3_ij", (void *)&SC_GetElementAt1_int3, true },
885d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int413rs_allocationPDv4_ij", (void *)&SC_GetElementAt1_int4, true },
886d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z18rsGetElementAt_int13rs_allocationPijj", (void *)&SC_GetElementAt2_int, true },
887d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int213rs_allocationPDv2_ijj", (void *)&SC_GetElementAt2_int2, true },
888d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int313rs_allocationPDv3_ijj", (void *)&SC_GetElementAt2_int3, true },
889d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int413rs_allocationPDv4_ijj", (void *)&SC_GetElementAt2_int4, true },
890d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z18rsGetElementAt_int13rs_allocationPijjj", (void *)&SC_GetElementAt3_int, true },
891d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int213rs_allocationPDv2_ijjj", (void *)&SC_GetElementAt3_int2, true },
892d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int313rs_allocationPDv3_ijjj", (void *)&SC_GetElementAt3_int3, true },
893d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_int413rs_allocationPDv4_ijjj", (void *)&SC_GetElementAt3_int4, true },
894d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
895d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_ulong13rs_allocationPmj", (void *)&SC_GetElementAt1_ulong, true },
896d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mj", (void *)&SC_GetElementAt1_ulong2, true },
897d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mj", (void *)&SC_GetElementAt1_ulong3, true },
898d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mj", (void *)&SC_GetElementAt1_ulong4, true },
899d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_ulong13rs_allocationPmjj", (void *)&SC_GetElementAt2_ulong, true },
900d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjj", (void *)&SC_GetElementAt2_ulong2, true },
901d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjj", (void *)&SC_GetElementAt2_ulong3, true },
902d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjj", (void *)&SC_GetElementAt2_ulong4, true },
903d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_ulong13rs_allocationPmjjj", (void *)&SC_GetElementAt3_ulong, true },
904d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjjj", (void *)&SC_GetElementAt3_ulong2, true },
905d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjjj", (void *)&SC_GetElementAt3_ulong3, true },
906d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjjj", (void *)&SC_GetElementAt3_ulong4, true },
907d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
908d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_long13rs_allocationPlj", (void *)&SC_GetElementAt1_long, true },
909d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long213rs_allocationPDv2_lj", (void *)&SC_GetElementAt1_long2, true },
910d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long313rs_allocationPDv3_lj", (void *)&SC_GetElementAt1_long3, true },
911d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long413rs_allocationPDv4_lj", (void *)&SC_GetElementAt1_long4, true },
912d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_long13rs_allocationPljj", (void *)&SC_GetElementAt2_long, true },
913d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long213rs_allocationPDv2_ljj", (void *)&SC_GetElementAt2_long2, true },
914d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long313rs_allocationPDv3_ljj", (void *)&SC_GetElementAt2_long3, true },
915d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long413rs_allocationPDv4_ljj", (void *)&SC_GetElementAt2_long4, true },
916d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsGetElementAt_long13rs_allocationPljjj", (void *)&SC_GetElementAt3_long, true },
917d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long213rs_allocationPDv2_ljjj", (void *)&SC_GetElementAt3_long2, true },
918d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long313rs_allocationPDv3_ljjj", (void *)&SC_GetElementAt3_long3, true },
919d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_long413rs_allocationPDv4_ljjj", (void *)&SC_GetElementAt3_long4, true },
920d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
921d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_float13rs_allocationPfj", (void *)&SC_GetElementAt1_float, true },
922d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float213rs_allocationPDv2_fj", (void *)&SC_GetElementAt1_float2, true },
923d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float313rs_allocationPDv3_fj", (void *)&SC_GetElementAt1_float3, true },
924d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float413rs_allocationPDv4_fj", (void *)&SC_GetElementAt1_float4, true },
925d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_float13rs_allocationPfjj", (void *)&SC_GetElementAt2_float, true },
926d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float213rs_allocationPDv2_fjj", (void *)&SC_GetElementAt2_float2, true },
927d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float313rs_allocationPDv3_fjj", (void *)&SC_GetElementAt2_float3, true },
928d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float413rs_allocationPDv4_fjj", (void *)&SC_GetElementAt2_float4, true },
929d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsGetElementAt_float13rs_allocationPfjjj", (void *)&SC_GetElementAt3_float, true },
930d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float213rs_allocationPDv2_fjjj", (void *)&SC_GetElementAt3_float2, true },
931d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float313rs_allocationPDv3_fjjj", (void *)&SC_GetElementAt3_float3, true },
932d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_float413rs_allocationPDv4_fjjj", (void *)&SC_GetElementAt3_float4, true },
933d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
934d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_double13rs_allocationPdj", (void *)&SC_GetElementAt1_double, true },
935d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double213rs_allocationPDv2_dj", (void *)&SC_GetElementAt1_double2, true },
936d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double313rs_allocationPDv3_dj", (void *)&SC_GetElementAt1_double3, true },
937d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double413rs_allocationPDv4_dj", (void *)&SC_GetElementAt1_double4, true },
938d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_double13rs_allocationPdjj", (void *)&SC_GetElementAt2_double, true },
939d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double213rs_allocationPDv2_djj", (void *)&SC_GetElementAt2_double2, true },
940d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double313rs_allocationPDv3_djj", (void *)&SC_GetElementAt2_double3, true },
941d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double413rs_allocationPDv4_djj", (void *)&SC_GetElementAt2_double4, true },
942d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsGetElementAt_double13rs_allocationPdjjj", (void *)&SC_GetElementAt3_double, true },
943d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double213rs_allocationPDv2_djjj", (void *)&SC_GetElementAt3_double2, true },
944d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double313rs_allocationPDv3_djjj", (void *)&SC_GetElementAt3_double3, true },
945d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsGetElementAt_double413rs_allocationPDv4_djjj", (void *)&SC_GetElementAt3_double4, true },
946d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
947d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
948d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
949d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uchar13rs_allocationPKhj", (void *)&SC_SetElementAt1_uchar, true },
950d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hj", (void *)&SC_SetElementAt1_uchar2, true },
951d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hj", (void *)&SC_SetElementAt1_uchar3, true },
952d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hj", (void *)&SC_SetElementAt1_uchar4, true },
953d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uchar13rs_allocationPKhjj", (void *)&SC_SetElementAt2_uchar, true },
954d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjj", (void *)&SC_SetElementAt2_uchar2, true },
955d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjj", (void *)&SC_SetElementAt2_uchar3, true },
956d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjj", (void *)&SC_SetElementAt2_uchar4, true },
957d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uchar13rs_allocationPKhjjj", (void *)&SC_SetElementAt3_uchar, true },
958d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjjj", (void *)&SC_SetElementAt3_uchar2, true },
959d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjjj", (void *)&SC_SetElementAt3_uchar3, true },
960d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjjj", (void *)&SC_SetElementAt3_uchar4, true },
961d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
962d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_char13rs_allocationPKcj", (void *)&SC_SetElementAt1_char, true },
963d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cj", (void *)&SC_SetElementAt1_char2, true },
964d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cj", (void *)&SC_SetElementAt1_char3, true },
965d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cj", (void *)&SC_SetElementAt1_char4, true },
966d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_char13rs_allocationPKcjj", (void *)&SC_SetElementAt2_char, true },
967d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjj", (void *)&SC_SetElementAt2_char2, true },
968d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjj", (void *)&SC_SetElementAt2_char3, true },
969d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjj", (void *)&SC_SetElementAt2_char4, true },
970d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_char13rs_allocationPKcjjj", (void *)&SC_SetElementAt3_char, true },
971d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjjj", (void *)&SC_SetElementAt3_char2, true },
972d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjjj", (void *)&SC_SetElementAt3_char3, true },
973d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjjj", (void *)&SC_SetElementAt3_char4, true },
974d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
975d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ushort13rs_allocationPKht", (void *)&SC_SetElementAt1_ushort, true },
976d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tj", (void *)&SC_SetElementAt1_ushort2, true },
977d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tj", (void *)&SC_SetElementAt1_ushort3, true },
978d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tj", (void *)&SC_SetElementAt1_ushort4, true },
979d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ushort13rs_allocationPKtjj", (void *)&SC_SetElementAt2_ushort, true },
980d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjj", (void *)&SC_SetElementAt2_ushort2, true },
981d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjj", (void *)&SC_SetElementAt2_ushort3, true },
982d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjj", (void *)&SC_SetElementAt2_ushort4, true },
983d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ushort13rs_allocationPKtjjj", (void *)&SC_SetElementAt3_ushort, true },
984d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjjj", (void *)&SC_SetElementAt3_ushort2, true },
985d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjjj", (void *)&SC_SetElementAt3_ushort3, true },
986d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjjj", (void *)&SC_SetElementAt3_ushort4, true },
987d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
988d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_short13rs_allocationPKsj", (void *)&SC_SetElementAt1_short, true },
989d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sj", (void *)&SC_SetElementAt1_short2, true },
990d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sj", (void *)&SC_SetElementAt1_short3, true },
991d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sj", (void *)&SC_SetElementAt1_short4, true },
992d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_short13rs_allocationPKsjj", (void *)&SC_SetElementAt2_short, true },
993d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjj", (void *)&SC_SetElementAt2_short2, true },
994d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjj", (void *)&SC_SetElementAt2_short3, true },
995d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjj", (void *)&SC_SetElementAt2_short4, true },
996d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_short13rs_allocationPKsjjj", (void *)&SC_SetElementAt3_short, true },
997d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjjj", (void *)&SC_SetElementAt3_short2, true },
998d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjjj", (void *)&SC_SetElementAt3_short3, true },
999d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjjj", (void *)&SC_SetElementAt3_short4, true },
1000d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1001d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_uint13rs_allocationPKjj", (void *)&SC_SetElementAt1_uint, true },
1002d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jj", (void *)&SC_SetElementAt1_uint2, true },
1003d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jj", (void *)&SC_SetElementAt1_uint3, true },
1004d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jj", (void *)&SC_SetElementAt1_uint4, true },
1005d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_uint13rs_allocationPKjjj", (void *)&SC_SetElementAt2_uint, true },
1006d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjj", (void *)&SC_SetElementAt2_uint2, true },
1007d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjj", (void *)&SC_SetElementAt2_uint3, true },
1008d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjj", (void *)&SC_SetElementAt2_uint4, true },
1009d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_uint13rs_allocationPKjjjj", (void *)&SC_SetElementAt3_uint, true },
1010d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjjj", (void *)&SC_SetElementAt3_uint2, true },
1011d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjjj", (void *)&SC_SetElementAt3_uint3, true },
1012d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjjj", (void *)&SC_SetElementAt3_uint4, true },
1013d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1014cca3d6ca444bef3b6d75431ec19bd07bfe40a733Stephen Hines    { "_Z18rsSetElementAt_int13rs_allocationPKij", (void *)&SC_SetElementAt1_int, true },
1015d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ij", (void *)&SC_SetElementAt1_int2, true },
1016d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ij", (void *)&SC_SetElementAt1_int3, true },
1017d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ij", (void *)&SC_SetElementAt1_int4, true },
1018d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z18rsSetElementAt_int13rs_allocationPKijj", (void *)&SC_SetElementAt2_int, true },
1019d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijj", (void *)&SC_SetElementAt2_int2, true },
1020d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijj", (void *)&SC_SetElementAt2_int3, true },
1021d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijj", (void *)&SC_SetElementAt2_int4, true },
1022d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z18rsSetElementAt_int13rs_allocationPKijjj", (void *)&SC_SetElementAt3_int, true },
1023d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijjj", (void *)&SC_SetElementAt3_int2, true },
1024d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijjj", (void *)&SC_SetElementAt3_int3, true },
1025d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijjj", (void *)&SC_SetElementAt3_int4, true },
1026d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1027d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_ulong13rs_allocationPKmt", (void *)&SC_SetElementAt1_ulong, true },
1028d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mj", (void *)&SC_SetElementAt1_ulong2, true },
1029d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mj", (void *)&SC_SetElementAt1_ulong3, true },
1030d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mj", (void *)&SC_SetElementAt1_ulong4, true },
1031d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_ulong13rs_allocationPKmjj", (void *)&SC_SetElementAt2_ulong, true },
1032d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjj", (void *)&SC_SetElementAt2_ulong2, true },
1033d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjj", (void *)&SC_SetElementAt2_ulong3, true },
1034d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjj", (void *)&SC_SetElementAt2_ulong4, true },
1035d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_ulong13rs_allocationPKmjjj", (void *)&SC_SetElementAt3_ulong, true },
1036d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjjj", (void *)&SC_SetElementAt3_ulong2, true },
1037d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjjj", (void *)&SC_SetElementAt3_ulong3, true },
1038d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjjj", (void *)&SC_SetElementAt3_ulong4, true },
1039d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1040d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_long13rs_allocationPKlj", (void *)&SC_SetElementAt1_long, true },
1041d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long213rs_allocationPKDv2_lj", (void *)&SC_SetElementAt1_long2, true },
1042d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long313rs_allocationPKDv3_lj", (void *)&SC_SetElementAt1_long3, true },
1043d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long413rs_allocationPKDv4_lj", (void *)&SC_SetElementAt1_long4, true },
1044d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_long13rs_allocationPKljj", (void *)&SC_SetElementAt2_long, true },
1045d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljj", (void *)&SC_SetElementAt2_long2, true },
1046d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljj", (void *)&SC_SetElementAt2_long3, true },
1047d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljj", (void *)&SC_SetElementAt2_long4, true },
1048d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z19rsSetElementAt_long13rs_allocationPKljjj", (void *)&SC_SetElementAt3_long, true },
1049d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljjj", (void *)&SC_SetElementAt3_long2, true },
1050d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljjj", (void *)&SC_SetElementAt3_long3, true },
1051d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljjj", (void *)&SC_SetElementAt3_long4, true },
1052d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1053d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_float13rs_allocationPKft", (void *)&SC_SetElementAt1_float, true },
1054d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fj", (void *)&SC_SetElementAt1_float2, true },
1055d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fj", (void *)&SC_SetElementAt1_float3, true },
1056d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fj", (void *)&SC_SetElementAt1_float4, true },
1057d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_float13rs_allocationPKfjj", (void *)&SC_SetElementAt2_float, true },
1058d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjj", (void *)&SC_SetElementAt2_float2, true },
1059d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjj", (void *)&SC_SetElementAt2_float3, true },
1060d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjj", (void *)&SC_SetElementAt2_float4, true },
1061d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z20rsSetElementAt_float13rs_allocationPKfjjj", (void *)&SC_SetElementAt3_float, true },
1062d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjjj", (void *)&SC_SetElementAt3_float2, true },
1063d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjjj", (void *)&SC_SetElementAt3_float3, true },
1064d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjjj", (void *)&SC_SetElementAt3_float4, true },
1065d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams
1066d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_double13rs_allocationPKdt", (void *)&SC_SetElementAt1_double, true },
1067d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double213rs_allocationPKDv2_dj", (void *)&SC_SetElementAt1_double2, true },
1068d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double313rs_allocationPKDv3_dj", (void *)&SC_SetElementAt1_double3, true },
1069d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double413rs_allocationPKDv4_dj", (void *)&SC_SetElementAt1_double4, true },
1070d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_double13rs_allocationPKdjj", (void *)&SC_SetElementAt2_double, true },
1071d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double213rs_allocationPKDv2_djj", (void *)&SC_SetElementAt2_double2, true },
1072d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double313rs_allocationPKDv3_djj", (void *)&SC_SetElementAt2_double3, true },
1073d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double413rs_allocationPKDv4_djj", (void *)&SC_SetElementAt2_double4, true },
1074d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z21rsSetElementAt_double13rs_allocationPKdjjj", (void *)&SC_SetElementAt3_double, true },
1075d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double213rs_allocationPKDv2_djjj", (void *)&SC_SetElementAt3_double2, true },
1076d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double313rs_allocationPKDv3_djjj", (void *)&SC_SetElementAt3_double3, true },
1077d09b9d667438c82e00c83cd21f693f32e3cf9f4bJason Sams    { "_Z22rsSetElementAt_double413rs_allocationPKDv4_djjj", (void *)&SC_SetElementAt3_double4, true },
10785261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
10795261a5ea546ff358edd5aac7602fc4132434f481Jason Sams
108087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    // Refcounting
108187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject, true },
108287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP10rs_element", (void *)&SC_ClearObject, true },
108387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject10rs_element", (void *)&SC_IsObject, true },
108487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
108587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject, true },
108687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP7rs_type", (void *)&SC_ClearObject, true },
108787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject7rs_type", (void *)&SC_IsObject, true },
108887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
108987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject, true },
109087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_ClearObject, true },
109187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject, true },
109287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
109387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject, true },
109487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP10rs_sampler", (void *)&SC_ClearObject, true },
109587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject, true },
109687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
109787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject, true },
109887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP9rs_script", (void *)&SC_ClearObject, true },
109987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject9rs_script", (void *)&SC_IsObject, true },
110087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
11019e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams    { "_Z11rsSetObjectP7rs_pathS_", (void *)&SC_SetObject, true },
11029e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams    { "_Z13rsClearObjectP7rs_path", (void *)&SC_ClearObject, true },
11039e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams    { "_Z10rsIsObject7rs_path", (void *)&SC_IsObject, true },
11049e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams
110587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_SetObject, true },
110687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP7rs_mesh", (void *)&SC_ClearObject, true },
110787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject7rs_mesh", (void *)&SC_IsObject, true },
110887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
110987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_SetObject, true },
111087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_ClearObject, true },
111187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject19rs_program_fragment", (void *)&SC_IsObject, true },
111287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
111387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_SetObject, true },
111487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_ClearObject, true },
111587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject17rs_program_vertex", (void *)&SC_IsObject, true },
111687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
111787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_SetObject, true },
111887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_ClearObject, true },
111987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject17rs_program_raster", (void *)&SC_IsObject, true },
112087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
112187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_SetObject, true },
112287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP16rs_program_store", (void *)&SC_ClearObject, true },
112387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject16rs_program_store", (void *)&SC_IsObject, true },
112487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
112587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_SetObject, true },
112687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsClearObjectP7rs_font", (void *)&SC_ClearObject, true },
112787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z10rsIsObject7rs_font", (void *)&SC_IsObject, true },
112887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
112987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    // Allocation ops
113087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_AllocationSyncAll, true },
113187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z20rsgAllocationSyncAll13rs_allocation", (void *)&SC_AllocationSyncAll, false },
113287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z20rsgAllocationSyncAll13rs_allocationj", (void *)&SC_AllocationSyncAll2, false },
113374a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk    { "_Z20rsgAllocationSyncAll13rs_allocation24rs_allocation_usage_type", (void *)&SC_AllocationSyncAll2, false },
113487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z15rsGetAllocationPKv", (void *)&SC_GetAllocation, true },
11350b575de8ed0b628d84d256f5846500b0385979bdTim Murray#ifndef RS_COMPATIBILITY_LIB
1136b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams    { "_Z18rsAllocationIoSend13rs_allocation", (void *)&SC_AllocationIoSend, false },
1137b322033c13487a174bb9c26466e9684d1ff4de8dJason Sams    { "_Z21rsAllocationIoReceive13rs_allocation", (void *)&SC_AllocationIoReceive, false },
11380b575de8ed0b628d84d256f5846500b0385979bdTim Murray#endif
113974a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk    { "_Z23rsAllocationCopy1DRange13rs_allocationjjjS_jj", (void *)&SC_AllocationCopy1DRange, false },
114074a827988567a9d65954bb0d825a3ba4a97e2947Alex Sakhartchouk    { "_Z23rsAllocationCopy2DRange13rs_allocationjjj26rs_allocation_cubemap_facejjS_jjjS0_", (void *)&SC_AllocationCopy2DRange, false },
114187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
114287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    // Messaging
114387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
114487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsSendToClienti", (void *)&SC_ToClient, false },
114587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsSendToClientiPKvj", (void *)&SC_ToClient2, false },
114687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z22rsSendToClientBlockingi", (void *)&SC_ToClientBlocking, false },
114787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_ToClientBlocking2, false },
11480b575de8ed0b628d84d256f5846500b0385979bdTim Murray#ifndef RS_COMPATIBILITY_LIB
114987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_BindProgramFragment, false },
115087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_BindProgramStore, false },
115187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_BindProgramVertex, false },
115287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_BindProgramRaster, false },
115387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_BindSampler, false },
115487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_BindTexture, false },
1155a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk    { "_Z15rsgBindConstant19rs_program_fragmentj13rs_allocation", (void *)&SC_BindFragmentConstant, false },
1156a720a144508edd91e4790b23eadd6cd270368df9Alex Sakhartchouk    { "_Z15rsgBindConstant17rs_program_vertexj13rs_allocation", (void *)&SC_BindVertexConstant, false },
115787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
115887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadProjectionMatrix, false },
115987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadModelMatrix, false },
116087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadTextureMatrix, false },
116187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
116287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_VpGetProjectionMatrix, false },
116387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
116487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_PfConstantColor, false },
116587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
116687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgGetWidthv", (void *)&SC_GetWidth, false },
116787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z12rsgGetHeightv", (void *)&SC_GetHeight, false },
116887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
116987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
117087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawRectfffff", (void *)&SC_DrawRect, false },
117187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawQuadffffffffffff", (void *)&SC_DrawQuad, false },
117287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_DrawQuadTexCoords, false },
117387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_DrawSpriteScreenspace, false },
117487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
117587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_DrawMesh, false },
117687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_DrawMeshPrimitive, false },
117787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_DrawMeshPrimitiveRange, false },
117887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_MeshComputeBoundingBox, false },
117987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
11809e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams    { "_Z11rsgDrawPath7rs_path", (void *)&SC_DrawPath, false },
11819e0afb5a2b3e476c42a373e7cd89cef4a34f8195Jason Sams
118287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsgClearColorffff", (void *)&SC_ClearColor, false },
118387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth, false },
118487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
118587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText, false },
118687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc, false },
118787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText, false },
118887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc, false },
118987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
119087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont, false },
119187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z12rsgFontColorffff", (void *)&SC_FontColor, false },
119287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
119387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z18rsgBindColorTarget13rs_allocationj", (void *)&SC_BindFrameBufferObjectColorTarget, false },
119487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z18rsgBindDepthTarget13rs_allocation", (void *)&SC_BindFrameBufferObjectDepthTarget, false },
119587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z19rsgClearColorTargetj", (void *)&SC_ClearFrameBufferObjectColorTarget, false },
119687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false },
119787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false },
11980b575de8ed0b628d84d256f5846500b0385979bdTim Murray#endif // RS_COMPATIBILITY_LIB
119987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
1200aa152101cc4d04597d9aefc3e5a1454eaf39d2ccJason Sams    { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, true },
1201aa152101cc4d04597d9aefc3e5a1454eaf39d2ccJason Sams    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, true },
1202f598811a60088236222bb1879503842094ca378bStephen Hines    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK14rs_script_call", (void *)&SC_ForEach_SAAUS, true },
1203aa152101cc4d04597d9aefc3e5a1454eaf39d2ccJason Sams    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, true },
1204f598811a60088236222bb1879503842094ca378bStephen Hines    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK14rs_script_call", (void *)&SC_ForEach_SAAULS, true },
120587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
120687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    // time
120787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z6rsTimePi", (void *)&SC_Time, true },
120887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z11rsLocaltimeP5rs_tmPKi", (void *)&SC_LocalTime, true },
120987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z14rsUptimeMillisv", (void*)&SC_UptimeMillis, true },
121087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z13rsUptimeNanosv", (void*)&SC_UptimeNanos, true },
121187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z7rsGetDtv", (void*)&SC_GetDt, false },
121287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
121387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    // misc
12140b575de8ed0b628d84d256f5846500b0385979bdTim Murray#ifndef RS_COMPATIBILITY_LIB
121587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z5colorffff", (void *)&SC_Color, false },
121687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { "_Z9rsgFinishv", (void *)&SC_Finish, false },
12170b575de8ed0b628d84d256f5846500b0385979bdTim Murray#endif
121887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
121987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    { NULL, NULL, false }
122087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams};
122187fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
12220b575de8ed0b628d84d256f5846500b0385979bdTim Murray#ifdef RS_COMPATIBILITY_LIB
12230b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1224d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray//////////////////////////////////////////////////////////////////////////////
1225d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray// Compatibility Library entry points
1226d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray//////////////////////////////////////////////////////////////////////////////
1227d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1228f827cadde659212b266b9635128c98515a7dcb01Stephen Hines#define IS_CLEAR_SET_OBJ(t) \
1229f827cadde659212b266b9635128c98515a7dcb01Stephen Hines    bool rsIsObject(t src) { \
1230f827cadde659212b266b9635128c98515a7dcb01Stephen Hines        return SC_IsObject((ObjectBase*)src.p); \
1231f827cadde659212b266b9635128c98515a7dcb01Stephen Hines    } \
1232d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    void __attribute__((overloadable)) rsClearObject(t *dst) { \
1233f827cadde659212b266b9635128c98515a7dcb01Stephen Hines        return SC_ClearObject((ObjectBase**) dst); \
1234d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    } \
1235d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    void __attribute__((overloadable)) rsSetObject(t *dst, t src) { \
1236f827cadde659212b266b9635128c98515a7dcb01Stephen Hines        return SC_SetObject((ObjectBase**) dst, (ObjectBase*) src.p); \
1237d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    }
1238d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1239f827cadde659212b266b9635128c98515a7dcb01Stephen HinesIS_CLEAR_SET_OBJ(rs_element)
1240f827cadde659212b266b9635128c98515a7dcb01Stephen HinesIS_CLEAR_SET_OBJ(rs_type)
1241f827cadde659212b266b9635128c98515a7dcb01Stephen HinesIS_CLEAR_SET_OBJ(rs_allocation)
1242f827cadde659212b266b9635128c98515a7dcb01Stephen HinesIS_CLEAR_SET_OBJ(rs_sampler)
1243f827cadde659212b266b9635128c98515a7dcb01Stephen HinesIS_CLEAR_SET_OBJ(rs_script)
1244f827cadde659212b266b9635128c98515a7dcb01Stephen Hines#undef IS_CLEAR_SET_OBJ
1245d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1246d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayconst Allocation * rsGetAllocation(const void *ptr) {
1247d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return SC_GetAllocation(ptr);
1248d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1249d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
12507a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hinesvoid __attribute__((overloadable)) rsAllocationIoSend(rs_allocation a) {
12517a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines    SC_AllocationIoSend((Allocation *)a.p);
12527a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines}
12537a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
12547a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hinesvoid __attribute__((overloadable)) rsAllocationIoReceive(rs_allocation a) {
12557a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines    SC_AllocationIoReceive((Allocation *)a.p);
12567a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines}
12577a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
12587a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
12597a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hinesvoid __attribute__((overloadable)) rsAllocationCopy1DRange(
12607a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        rs_allocation dstAlloc,
12617a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t dstOff, uint32_t dstMip, uint32_t count,
12627a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        rs_allocation srcAlloc,
12637a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t srcOff, uint32_t srcMip) {
12647a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines    SC_AllocationCopy1DRange((Allocation *)dstAlloc.p, dstOff, dstMip, count,
12657a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines                             (Allocation *)srcAlloc.p, srcOff, srcMip);
12667a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines}
12677a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
12687a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hinesvoid __attribute__((overloadable)) rsAllocationCopy2DRange(
12697a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        rs_allocation dstAlloc,
12707a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t dstXoff, uint32_t dstYoff,
12717a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t dstMip, rs_allocation_cubemap_face dstFace,
12727a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t width, uint32_t height,
12737a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        rs_allocation srcAlloc,
12747a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t srcXoff, uint32_t srcYoff,
12757a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines        uint32_t srcMip, rs_allocation_cubemap_face srcFace) {
12767a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines    SC_AllocationCopy2DRange((Allocation *)dstAlloc.p, dstXoff, dstYoff,
12777a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines                             dstMip, dstFace, width, height,
12787a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines                             (Allocation *)srcAlloc.p, srcXoff, srcYoff,
12797a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines                             srcMip, srcFace);
12807a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines}
12817a01126d25c081f5b613eea80e5ff7e6c75c940fStephen Hines
1282d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayvoid __attribute__((overloadable)) rsForEach(rs_script script,
1283d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             rs_allocation in,
1284d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             rs_allocation out,
1285d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             const void *usr,
1286d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             const rs_script_call *call) {
1287d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return SC_ForEach_SAAUS((Script *)script.p, (Allocation*)in.p, (Allocation*)out.p, usr, (RsScriptCall*)call);
1288d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1289d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1290d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayvoid __attribute__((overloadable)) rsForEach(rs_script script,
1291d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             rs_allocation in,
1292276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             rs_allocation out) {
1293276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ForEach_SAA((Script *)script.p, (Allocation*)in.p, (Allocation*)out.p);
1294276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines}
1295276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines
1296276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesvoid __attribute__((overloadable)) rsForEach(rs_script script,
1297276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             rs_allocation in,
1298276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             rs_allocation out,
1299276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             const void *usr,
1300276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             uint32_t usrLen) {
1301276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ForEach_SAAUL((Script *)script.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen);
1302276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines}
1303276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines
1304276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesvoid __attribute__((overloadable)) rsForEach(rs_script script,
1305276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines                                             rs_allocation in,
1306d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             rs_allocation out,
1307d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             const void *usr,
1308d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             uint32_t usrLen,
1309d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray                                             const rs_script_call *call) {
1310d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return SC_ForEach_SAAULS((Script *)script.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen, (RsScriptCall*)call);
1311d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1312d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1313d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayint rsTime(int *timer) {
1314d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return SC_Time(timer);
1315d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1316d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1317d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayrs_tm* rsLocaltime(rs_tm* local, const int *timer) {
1318d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return (rs_tm*)(SC_LocalTime((tm*)local, (long*)timer));
1319d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1320d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1321d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murrayint64_t rsUptimeMillis() {
1322d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    Context *rsc = RsdCpuReference::getTlsContext();
1323d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    return rsrUptimeMillis(rsc);
1324d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1325d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
1326276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesuint32_t rsSendToClient(int cmdID) {
1327276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ToClient(cmdID);
1328276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines}
1329276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines
1330276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesuint32_t rsSendToClient(int cmdID, const void *data, uint32_t len) {
1331276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ToClient2(cmdID, data, len);
1332d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray}
1333d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray
13340b575de8ed0b628d84d256f5846500b0385979bdTim Murrayuint32_t rsSendToClientBlocking(int cmdID) {
1335276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ToClientBlocking(cmdID);
1336276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines}
1337276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines
1338276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hinesuint32_t rsSendToClientBlocking(int cmdID, const void *data, uint32_t len) {
1339276000a3673e639f9abc41db4709c1b0a96c1bf9Stephen Hines    return SC_ToClientBlocking2(cmdID, data, len);
13400b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13410b575de8ed0b628d84d256f5846500b0385979bdTim Murray
13420b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugF(const char *s, float f) {
13430b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f)));
13440b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13450b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFv2(const char *s, float f1, float f2) {
13460b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f}", s, f1, f2);
13470b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13480b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFv3(const char *s, float f1, float f2, float f3) {
13490b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f}", s, f1, f2, f3);
13500b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13510b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) {
13520b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4);
13530b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13540b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugF2(const char *s, float2 f) {
13550b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f}", s, f.x, f.y);
13560b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13570b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugF3(const char *s, float3 f) {
13580b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f}", s, f.x, f.y, f.z);
13590b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13600b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugF4(const char *s, float4 f) {
13610b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f, %f}", s, f.x, f.y, f.z, f.w);
13620b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13630b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugD(const char *s, double d) {
13640b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d)));
13650b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13660b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFM4v4(const char *s, const float *f) {
13670b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]);
13680b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]);
13690b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]);
13700b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]);
13710b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13720b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFM3v3(const char *s, const float *f) {
13730b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]);
13740b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f, %f", s, f[1], f[4], f[7]);
13750b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f, %f}",s, f[2], f[5], f[8]);
13760b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13770b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugFM2v2(const char *s, const float *f) {
13780b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%f, %f", s, f[0], f[2]);
13790b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s  %f, %f}",s, f[1], f[3]);
13800b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13810b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI8(const char *s, char c) {
13820b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %hhd  0x%hhx", s, c, (unsigned char)c);
13830b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13840b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugC2(const char *s, char2 c) {
13850b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhd, %hhd}  0x%hhx 0x%hhx", s, c.x, c.y, (unsigned char)c.x, (unsigned char)c.y);
13860b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13870b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugC3(const char *s, char3 c) {
13880b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhd, %hhd, %hhd}  0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, (unsigned char)c.x, (unsigned char)c.y, (unsigned char)c.z);
13890b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13900b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugC4(const char *s, char4 c) {
13910b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhd, %hhd, %hhd, %hhd}  0x%hhx 0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, c.w, (unsigned char)c.x, (unsigned char)c.y, (unsigned char)c.z, (unsigned char)c.w);
13920b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13930b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugU8(const char *s, unsigned char c) {
13940b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %hhu  0x%hhx", s, c, c);
13950b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13960b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUC2(const char *s, uchar2 c) {
13970b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhu, %hhu}  0x%hhx 0x%hhx", s, c.x, c.y, c.x, c.y);
13980b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
13990b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUC3(const char *s, uchar3 c) {
14000b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhu, %hhu, %hhu}  0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, c.x, c.y, c.z);
14010b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14020b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUC4(const char *s, uchar4 c) {
14030b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hhu, %hhu, %hhu, %hhu}  0x%hhx 0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, c.w, c.x, c.y, c.z, c.w);
14040b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14050b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI16(const char *s, short c) {
14060b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %hd  0x%hx", s, c, c);
14070b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14080b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugS2(const char *s, short2 c) {
14090b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hd, %hd}  0x%hx 0x%hx", s, c.x, c.y, c.x, c.y);
14100b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14110b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugS3(const char *s, short3 c) {
14120b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hd, %hd, %hd}  0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z);
14130b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14140b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugS4(const char *s, short4 c) {
14150b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hd, %hd, %hd, %hd}  0x%hx 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.w, c.x, c.y, c.z, c.w);
14160b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14170b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugU16(const char *s, unsigned short c) {
14180b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %hu  0x%hx", s, c, c);
14190b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14200b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUS2(const char *s, ushort2 c) {
14210b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hu, %hu}  0x%hx 0x%hx", s, c.x, c.y, c.x, c.y);
14220b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14230b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUS3(const char *s, ushort3 c) {
14240b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hu, %hu, %hu}  0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z);
14250b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14260b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUS4(const char *s, ushort4 c) {
14270b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%hu, %hu, %hu, %hu}  0x%hx 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.w, c.x, c.y, c.z, c.w);
14280b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14290b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI32(const char *s, int32_t i) {
14300b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %d  0x%x", s, i, i);
14310b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14320b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI2(const char *s, int2 i) {
14330b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%d, %d}  0x%x 0x%x", s, i.x, i.y, i.x, i.y);
14340b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14350b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI3(const char *s, int3 i) {
14360b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%d, %d, %d}  0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z);
14370b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14380b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugI4(const char *s, int4 i) {
14390b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%d, %d, %d, %d}  0x%x 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.w, i.x, i.y, i.z, i.w);
14400b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14410b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugU32(const char *s, uint32_t i) {
14420b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %u  0x%x", s, i, i);
14430b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14440b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUI2(const char *s, uint2 i) {
14450b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%u, %u}  0x%x 0x%x", s, i.x, i.y, i.x, i.y);
14460b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14470b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUI3(const char *s, uint3 i) {
14480b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%u, %u, %u}  0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z);
14490b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14500b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUI4(const char *s, uint4 i) {
14510b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%u, %u, %u, %u}  0x%x 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.w, i.x, i.y, i.z, i.w);
14520b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14530b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugLL64(const char *s, long long ll) {
14540b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %lld  0x%llx", s, ll, ll);
14550b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14560b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugL2(const char *s, long2 ll) {
14570b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%lld, %lld}  0x%llx 0x%llx", s, ll.x, ll.y, ll.x, ll.y);
14580b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14590b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugL3(const char *s, long3 ll) {
14600b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%lld, %lld, %lld}  0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.x, ll.y, ll.z);
14610b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14620b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugL4(const char *s, long4 ll) {
14630b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%lld, %lld, %lld, %lld}  0x%llx 0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.w, ll.x, ll.y, ll.z, ll.w);
14640b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14650b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugULL64(const char *s, unsigned long long ll) {
14660b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %llu  0x%llx", s, ll, ll);
14670b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14680b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUL2(const char *s, ulong2 ll) {
14690b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%llu, %llu}  0x%llx 0x%llx", s, ll.x, ll.y, ll.x, ll.y);
14700b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14710b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUL3(const char *s, ulong3 ll) {
14720b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%llu, %llu, %llu}  0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.x, ll.y, ll.z);
14730b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14740b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugUL4(const char *s, ulong4 ll) {
14750b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s {%llu, %llu, %llu, %llu}  0x%llx 0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.w, ll.x, ll.y, ll.z, ll.w);
14760b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14770b575de8ed0b628d84d256f5846500b0385979bdTim Murraystatic void SC_debugP(const char *s, const void *p) {
14780b575de8ed0b628d84d256f5846500b0385979bdTim Murray    ALOGD("%s %p", s, p);
14790b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14800b575de8ed0b628d84d256f5846500b0385979bdTim Murray
14810b575de8ed0b628d84d256f5846500b0385979bdTim Murray// TODO: allocation ops, messaging, time
14820b575de8ed0b628d84d256f5846500b0385979bdTim Murray
14830b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, float f) {
14840b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugF(s, f);
14850b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14860b575de8ed0b628d84d256f5846500b0385979bdTim Murray
14870b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, float f1, float f2) {
14880b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugFv2(s, f1, f2);
14890b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14900b575de8ed0b628d84d256f5846500b0385979bdTim Murray
14910b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, float f1, float f2, float f3) {
14920b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugFv3(s, f1, f2, f3);
14930b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14940b575de8ed0b628d84d256f5846500b0385979bdTim Murray
14950b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, float f1, float f2, float f3, float f4) {
14960b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugFv4(s, f1, f2, f3, f4);
14970b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
14980b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1499b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const float2 *f) {
1500b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugF2(s, *f);
15010b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15020b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1503b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const float3 *f) {
1504b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugF3(s, *f);
15050b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15060b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1507b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const float4 *f) {
1508b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugF4(s, *f);
15090b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15100b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15110b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, double d) {
15120b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugD(s, d);
15130b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15140b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1515b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const rs_matrix4x4 *m) {
15160b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugFM4v4(s, (float *) m);
15170b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15180b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1519b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const rs_matrix3x3 *m) {
1520d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    SC_debugFM3v3(s, (float *) m);
15210b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15220b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1523b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const rs_matrix2x2 *m) {
1524d6f1f46b2929ed56c73ba32357cde31b82972fbeTim Murray    SC_debugFM2v2(s, (float *) m);
15250b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15260b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15270b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, char c) {
15280b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugI8(s, c);
15290b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15300b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1531b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const char2 *c) {
1532b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugC2(s, *c);
15330b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15340b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1535b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const char3 *c) {
1536b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugC3(s, *c);
15370b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15380b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1539b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const char4 *c) {
1540b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugC4(s, *c);
15410b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15420b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15430b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, unsigned char c) {
15440b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugU8(s, c);
15450b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15460b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1547b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uchar2 *c) {
1548b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUC2(s, *c);
15490b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15500b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1551b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uchar3 *c) {
1552b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUC3(s, *c);
15530b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15540b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1555b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uchar4 *c) {
1556b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUC4(s, *c);
15570b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15580b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15590b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, short c) {
15600b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugI16(s, c);
15610b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15620b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1563b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const short2 *c) {
1564b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugS2(s, *c);
15650b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15660b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1567b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const short3 *c) {
1568b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugS3(s, *c);
15690b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15700b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1571b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const short4 *c) {
1572b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugS4(s, *c);
15730b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15740b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15750b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, unsigned short c) {
15760b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugU16(s, c);
15770b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15780b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1579b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ushort2 *c) {
1580b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUS2(s, *c);
15810b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15820b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1583b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ushort3 *c) {
1584b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUS3(s, *c);
15850b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15860b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1587b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ushort4 *c) {
1588b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUS4(s, *c);
15890b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15900b575de8ed0b628d84d256f5846500b0385979bdTim Murray
15910b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, int c) {
15920b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugI32(s, c);
15930b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15940b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1595b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const int2 *c) {
1596b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugI2(s, *c);
15970b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
15980b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1599b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const int3 *c) {
1600b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugI3(s, *c);
16010b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16020b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1603b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const int4 *c) {
1604b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugI4(s, *c);
16050b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16060b575de8ed0b628d84d256f5846500b0385979bdTim Murray
16070b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, unsigned int c) {
16080b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugU32(s, c);
16090b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16100b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1611b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uint2 *c) {
1612b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUI2(s, *c);
16130b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16140b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1615b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uint3 *c) {
1616b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUI3(s, *c);
16170b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16180b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1619b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const uint4 *c) {
1620b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUI4(s, *c);
16210b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16220b575de8ed0b628d84d256f5846500b0385979bdTim Murray
16230b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, long c) {
16240b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugLL64(s, c);
16250b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16260b575de8ed0b628d84d256f5846500b0385979bdTim Murray
16270b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, long long c) {
16280b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugLL64(s, c);
16290b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16300b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1631b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const long2 *c) {
1632b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugL2(s, *c);
16330b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16340b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1635b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const long3 *c) {
1636b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugL3(s, *c);
16370b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16380b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1639b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const long4 *c) {
1640b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugL4(s, *c);
16410b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16420b575de8ed0b628d84d256f5846500b0385979bdTim Murray
16430b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, unsigned long c) {
16440b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugULL64(s, c);
16450b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16460b575de8ed0b628d84d256f5846500b0385979bdTim Murray
16470b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, unsigned long long c) {
16480b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugULL64(s, c);
16490b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16500b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1651b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ulong2 *c) {
1652b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUL2(s, *c);
16530b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16540b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1655b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ulong3 *c) {
1656b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUL3(s, *c);
16570b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16580b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1659b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hinesvoid rsDebug(const char *s, const ulong4 *c) {
1660b0934b67b95cc27e2358c2aa4db5f7c1067c8f9bStephen Hines    SC_debugUL4(s, *c);
16610b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
16620b575de8ed0b628d84d256f5846500b0385979bdTim Murray
1663a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines// FIXME: We need to export these function signatures for the compatibility
1664a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines// library. The C++ name mangling that LLVM uses for ext_vector_type requires
1665a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines// different versions for "long" vs. "long long". Note that the called
1666a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines// functions are still using the appropriate 64-bit sizes.
1667a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef long l2 __attribute__((ext_vector_type(2)));
1668a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef long l3 __attribute__((ext_vector_type(3)));
1669a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef long l4 __attribute__((ext_vector_type(4)));
1670a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef unsigned long ul2 __attribute__((ext_vector_type(2)));
1671a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef unsigned long ul3 __attribute__((ext_vector_type(3)));
1672a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinestypedef unsigned long ul4 __attribute__((ext_vector_type(4)));
1673a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1674a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const l2 *c) {
1675a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugL2(s, *(const long2 *)c);
1676a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1677a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1678a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const l3 *c) {
1679a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugL3(s, *(const long3 *)c);
1680a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1681a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1682a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const l4 *c) {
1683a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugL4(s, *(const long4 *)c);
1684a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1685a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1686a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const ul2 *c) {
1687a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugUL2(s, *(const ulong2 *)c);
1688a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1689a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1690a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const ul3 *c) {
1691a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugUL3(s, *(const ulong3 *)c);
1692a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1693a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
1694a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hinesvoid rsDebug(const char *s, const ul4 *c) {
1695a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines    SC_debugUL4(s, *(const ulong4 *)c);
1696a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines}
1697a5d9bef6b53ba394087c7c7b9cc60d3aaa7f121bStephen Hines
16980b575de8ed0b628d84d256f5846500b0385979bdTim Murrayvoid rsDebug(const char *s, const void *p) {
16990b575de8ed0b628d84d256f5846500b0385979bdTim Murray    SC_debugP(s, p);
17000b575de8ed0b628d84d256f5846500b0385979bdTim Murray}
17010b575de8ed0b628d84d256f5846500b0385979bdTim Murray#endif // RS_COMPATIBILITY_LIB
170287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
1703709a0978ae141198018ca9769f8d96292a8928e6Jason Samsextern const RsdCpuReference::CpuSymbol * rsdLookupRuntimeStub(Context * pContext, char const* name) {
170487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    ScriptC *s = (ScriptC *)pContext;
1705709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    const RsdCpuReference::CpuSymbol *syms = gSyms;
1706709a0978ae141198018ca9769f8d96292a8928e6Jason Sams    const RsdCpuReference::CpuSymbol *sym = NULL;
170787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
170887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    if (!sym) {
1709709a0978ae141198018ca9769f8d96292a8928e6Jason Sams        while (syms->fnPtr) {
1710709a0978ae141198018ca9769f8d96292a8928e6Jason Sams            if (!strcmp(syms->name, name)) {
1711709a0978ae141198018ca9769f8d96292a8928e6Jason Sams                return syms;
171287fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams            }
171387fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams            syms++;
171487fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams        }
171587fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    }
171687fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
171787fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams    return NULL;
171887fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams}
171987fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
172087fe59a2f4d4c74539bfa0bff5f9a7e320e99415Jason Sams
1721