Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1 | /* |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 2 | * Copyright (C) 2011-2012 The Android Open Source Project |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "rsContext.h" |
| 18 | #include "rsScriptC.h" |
| 19 | #include "rsMatrix4x4.h" |
| 20 | #include "rsMatrix3x3.h" |
| 21 | #include "rsMatrix2x2.h" |
| 22 | #include "rsRuntime.h" |
| 23 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 24 | #include "rsdCore.h" |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 25 | #include "rsdBcc.h" |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 26 | |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 27 | #include "rsdPath.h" |
Jason Sams | b322033 | 2012-04-02 14:41:54 -0700 | [diff] [blame] | 28 | #include "rsdAllocation.h" |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 29 | #include "rsdShaderCache.h" |
| 30 | #include "rsdVertexArray.h" |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 31 | |
| 32 | #include <time.h> |
| 33 | |
| 34 | using namespace android; |
| 35 | using namespace android::renderscript; |
| 36 | |
Rajeev Sharma | a1dd74c | 2012-07-09 03:14:47 -0700 | [diff] [blame] | 37 | typedef float float2 __attribute__((ext_vector_type(2))); |
| 38 | typedef float float3 __attribute__((ext_vector_type(3))); |
| 39 | typedef float float4 __attribute__((ext_vector_type(4))); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 40 | typedef double double2 __attribute__((ext_vector_type(2))); |
| 41 | typedef double double3 __attribute__((ext_vector_type(3))); |
| 42 | typedef double double4 __attribute__((ext_vector_type(4))); |
Rajeev Sharma | a1dd74c | 2012-07-09 03:14:47 -0700 | [diff] [blame] | 43 | typedef char char2 __attribute__((ext_vector_type(2))); |
| 44 | typedef char char3 __attribute__((ext_vector_type(3))); |
| 45 | typedef char char4 __attribute__((ext_vector_type(4))); |
| 46 | typedef unsigned char uchar2 __attribute__((ext_vector_type(2))); |
| 47 | typedef unsigned char uchar3 __attribute__((ext_vector_type(3))); |
| 48 | typedef unsigned char uchar4 __attribute__((ext_vector_type(4))); |
| 49 | typedef short short2 __attribute__((ext_vector_type(2))); |
| 50 | typedef short short3 __attribute__((ext_vector_type(3))); |
| 51 | typedef short short4 __attribute__((ext_vector_type(4))); |
| 52 | typedef unsigned short ushort2 __attribute__((ext_vector_type(2))); |
| 53 | typedef unsigned short ushort3 __attribute__((ext_vector_type(3))); |
| 54 | typedef unsigned short ushort4 __attribute__((ext_vector_type(4))); |
| 55 | typedef int32_t int2 __attribute__((ext_vector_type(2))); |
| 56 | typedef int32_t int3 __attribute__((ext_vector_type(3))); |
| 57 | typedef int32_t int4 __attribute__((ext_vector_type(4))); |
| 58 | typedef uint32_t uint2 __attribute__((ext_vector_type(2))); |
| 59 | typedef uint32_t uint3 __attribute__((ext_vector_type(3))); |
| 60 | typedef uint32_t uint4 __attribute__((ext_vector_type(4))); |
| 61 | typedef long long long2 __attribute__((ext_vector_type(2))); |
| 62 | typedef long long long3 __attribute__((ext_vector_type(3))); |
| 63 | typedef long long long4 __attribute__((ext_vector_type(4))); |
| 64 | typedef unsigned long long ulong2 __attribute__((ext_vector_type(2))); |
| 65 | typedef unsigned long long ulong3 __attribute__((ext_vector_type(3))); |
| 66 | typedef unsigned long long ulong4 __attribute__((ext_vector_type(4))); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 67 | |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 68 | typedef uint8_t uchar; |
| 69 | typedef uint16_t ushort; |
| 70 | typedef uint32_t uint; |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 71 | #ifndef RS_SERVER |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 72 | typedef uint64_t ulong; |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 73 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 74 | |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 75 | #ifdef RS_COMPATIBILITY_LIB |
| 76 | #define OPAQUETYPE(t) \ |
| 77 | typedef struct { const int* const p; } __attribute__((packed, aligned(4))) t; |
| 78 | |
| 79 | OPAQUETYPE(rs_element) |
| 80 | OPAQUETYPE(rs_type) |
| 81 | OPAQUETYPE(rs_allocation) |
| 82 | OPAQUETYPE(rs_sampler) |
| 83 | OPAQUETYPE(rs_script) |
| 84 | OPAQUETYPE(rs_script_call) |
| 85 | #undef OPAQUETYPE |
| 86 | |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 87 | typedef enum { |
| 88 | // Empty to avoid conflicting definitions with RsAllocationCubemapFace |
| 89 | } rs_allocation_cubemap_face; |
| 90 | |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 91 | typedef struct { |
| 92 | int tm_sec; ///< seconds |
| 93 | int tm_min; ///< minutes |
| 94 | int tm_hour; ///< hours |
| 95 | int tm_mday; ///< day of the month |
| 96 | int tm_mon; ///< month |
| 97 | int tm_year; ///< year |
| 98 | int tm_wday; ///< day of the week |
| 99 | int tm_yday; ///< day of the year |
| 100 | int tm_isdst; ///< daylight savings time |
| 101 | } rs_tm; |
| 102 | #endif |
| 103 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 104 | ////////////////////////////////////////////////////////////////////////////// |
| 105 | // Allocation |
| 106 | ////////////////////////////////////////////////////////////////////////////// |
| 107 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 108 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 109 | static void SC_AllocationSyncAll2(android::renderscript::rs_allocation a, RsAllocationUsageType source) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 110 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 111 | rsrAllocationSyncAll(rsc, (Allocation*)a.p, source); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 114 | static void SC_AllocationSyncAll(android::renderscript::rs_allocation a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 115 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 116 | rsrAllocationSyncAll(rsc, (Allocation*)a.p, RS_ALLOCATION_USAGE_SCRIPT); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 117 | } |
| 118 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 119 | #ifndef RS_COMPATIBILITY_LIB |
| 120 | |
| 121 | static void SC_AllocationCopy1DRange(android::renderscript::rs_allocation dstAlloc, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 122 | uint32_t dstOff, |
| 123 | uint32_t dstMip, |
| 124 | uint32_t count, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 125 | android::renderscript::rs_allocation srcAlloc, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 126 | uint32_t srcOff, uint32_t srcMip) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 127 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 128 | rsrAllocationCopy1DRange(rsc, (Allocation*)dstAlloc.p, dstOff, dstMip, count, |
| 129 | (Allocation*)srcAlloc.p, srcOff, srcMip); |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 130 | } |
| 131 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 132 | static void SC_AllocationCopy2DRange(android::renderscript::rs_allocation dstAlloc, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 133 | uint32_t dstXoff, uint32_t dstYoff, |
| 134 | uint32_t dstMip, uint32_t dstFace, |
| 135 | uint32_t width, uint32_t height, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 136 | android::renderscript::rs_allocation srcAlloc, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 137 | uint32_t srcXoff, uint32_t srcYoff, |
| 138 | uint32_t srcMip, uint32_t srcFace) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 139 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 140 | rsrAllocationCopy2DRange(rsc, (Allocation*)dstAlloc.p, |
Alex Sakhartchouk | a949524 | 2011-06-16 11:05:13 -0700 | [diff] [blame] | 141 | dstXoff, dstYoff, dstMip, dstFace, |
| 142 | width, height, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 143 | (Allocation*)srcAlloc.p, |
Alex Sakhartchouk | a949524 | 2011-06-16 11:05:13 -0700 | [diff] [blame] | 144 | srcXoff, srcYoff, srcMip, srcFace); |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 145 | } |
| 146 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 147 | static void SC_AllocationIoSend(android::renderscript::rs_allocation alloc) { |
| 148 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 149 | rsrAllocationIoSend(rsc, (Allocation*)alloc.p); |
| 150 | } |
| 151 | |
| 152 | |
| 153 | static void SC_AllocationIoReceive(android::renderscript::rs_allocation alloc) { |
| 154 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 155 | rsrAllocationIoReceive(rsc, (Allocation*)alloc.p); |
| 156 | } |
| 157 | |
| 158 | #else |
| 159 | |
| 160 | static void SC_AllocationCopy1DRange(::rs_allocation dstAlloc, |
| 161 | uint32_t dstOff, |
| 162 | uint32_t dstMip, |
| 163 | uint32_t count, |
| 164 | ::rs_allocation srcAlloc, |
| 165 | uint32_t srcOff, uint32_t srcMip) { |
| 166 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 167 | rsrAllocationCopy1DRange(rsc, (Allocation*)dstAlloc.p, dstOff, dstMip, count, |
| 168 | (Allocation*)srcAlloc.p, srcOff, srcMip); |
| 169 | } |
| 170 | |
| 171 | static void SC_AllocationCopy2DRange(::rs_allocation dstAlloc, |
| 172 | uint32_t dstXoff, uint32_t dstYoff, |
| 173 | uint32_t dstMip, uint32_t dstFace, |
| 174 | uint32_t width, uint32_t height, |
| 175 | ::rs_allocation srcAlloc, |
| 176 | uint32_t srcXoff, uint32_t srcYoff, |
| 177 | uint32_t srcMip, uint32_t srcFace) { |
| 178 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 179 | rsrAllocationCopy2DRange(rsc, (Allocation*)dstAlloc.p, |
| 180 | dstXoff, dstYoff, dstMip, dstFace, |
| 181 | width, height, |
| 182 | (Allocation*)srcAlloc.p, |
| 183 | srcXoff, srcYoff, srcMip, srcFace); |
| 184 | } |
| 185 | |
| 186 | static void SC_AllocationIoSend(Allocation* alloc) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 187 | Context *rsc = RsdCpuReference::getTlsContext(); |
Jason Sams | ddceab9 | 2013-08-07 13:02:32 -0700 | [diff] [blame] | 188 | rsrAllocationIoSend(rsc, alloc); |
Jason Sams | b322033 | 2012-04-02 14:41:54 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 192 | static void SC_AllocationIoReceive(Allocation* alloc) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 193 | Context *rsc = RsdCpuReference::getTlsContext(); |
Jason Sams | ddceab9 | 2013-08-07 13:02:32 -0700 | [diff] [blame] | 194 | rsrAllocationIoReceive(rsc, alloc); |
Jason Sams | b322033 | 2012-04-02 14:41:54 -0700 | [diff] [blame] | 195 | } |
| 196 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 197 | #endif |
| 198 | |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 199 | #ifndef RS_COMPATIBILITY_LIB |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 200 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 201 | ////////////////////////////////////////////////////////////////////////////// |
| 202 | // Context |
| 203 | ////////////////////////////////////////////////////////////////////////////// |
| 204 | |
| 205 | static void SC_BindTexture(ProgramFragment *pf, uint32_t slot, Allocation *a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 206 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 207 | rsrBindTexture(rsc, pf, slot, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Alex Sakhartchouk | a720a14 | 2012-01-10 10:16:52 -0800 | [diff] [blame] | 210 | static void SC_BindVertexConstant(ProgramVertex *pv, uint32_t slot, Allocation *a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 211 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 212 | rsrBindConstant(rsc, pv, slot, a); |
Alex Sakhartchouk | a720a14 | 2012-01-10 10:16:52 -0800 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | static void SC_BindFragmentConstant(ProgramFragment *pf, uint32_t slot, Allocation *a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 216 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 217 | rsrBindConstant(rsc, pf, slot, a); |
Alex Sakhartchouk | a720a14 | 2012-01-10 10:16:52 -0800 | [diff] [blame] | 218 | } |
| 219 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 220 | static void SC_BindSampler(ProgramFragment *pf, uint32_t slot, Sampler *s) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 221 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 222 | rsrBindSampler(rsc, pf, slot, s); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | static void SC_BindProgramStore(ProgramStore *ps) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 226 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 227 | rsrBindProgramStore(rsc, ps); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | static void SC_BindProgramFragment(ProgramFragment *pf) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 231 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 232 | rsrBindProgramFragment(rsc, pf); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | static void SC_BindProgramVertex(ProgramVertex *pv) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 236 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 237 | rsrBindProgramVertex(rsc, pv); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | static void SC_BindProgramRaster(ProgramRaster *pr) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 241 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 242 | rsrBindProgramRaster(rsc, pr); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | static void SC_BindFrameBufferObjectColorTarget(Allocation *a, uint32_t slot) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 246 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 247 | rsrBindFrameBufferObjectColorTarget(rsc, a, slot); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | static void SC_BindFrameBufferObjectDepthTarget(Allocation *a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 251 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 252 | rsrBindFrameBufferObjectDepthTarget(rsc, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | static void SC_ClearFrameBufferObjectColorTarget(uint32_t slot) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 256 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 257 | rsrClearFrameBufferObjectColorTarget(rsc, slot); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | static void SC_ClearFrameBufferObjectDepthTarget(Context *, Script *) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 261 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 262 | rsrClearFrameBufferObjectDepthTarget(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | static void SC_ClearFrameBufferObjectTargets(Context *, Script *) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 266 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 267 | rsrClearFrameBufferObjectTargets(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | |
| 271 | ////////////////////////////////////////////////////////////////////////////// |
| 272 | // VP |
| 273 | ////////////////////////////////////////////////////////////////////////////// |
| 274 | |
| 275 | static void SC_VpLoadProjectionMatrix(const rsc_Matrix *m) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 276 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 277 | rsrVpLoadProjectionMatrix(rsc, m); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | static void SC_VpLoadModelMatrix(const rsc_Matrix *m) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 281 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 282 | rsrVpLoadModelMatrix(rsc, m); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | static void SC_VpLoadTextureMatrix(const rsc_Matrix *m) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 286 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 287 | rsrVpLoadTextureMatrix(rsc, m); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | static void SC_PfConstantColor(ProgramFragment *pf, float r, float g, float b, float a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 291 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 292 | rsrPfConstantColor(rsc, pf, r, g, b, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | static void SC_VpGetProjectionMatrix(rsc_Matrix *m) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 296 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 297 | rsrVpGetProjectionMatrix(rsc, m); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | |
| 301 | ////////////////////////////////////////////////////////////////////////////// |
| 302 | // Drawing |
| 303 | ////////////////////////////////////////////////////////////////////////////// |
| 304 | |
| 305 | static void SC_DrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, |
| 306 | float x2, float y2, float z2, float u2, float v2, |
| 307 | float x3, float y3, float z3, float u3, float v3, |
| 308 | float x4, float y4, float z4, float u4, float v4) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 309 | Context *rsc = RsdCpuReference::getTlsContext(); |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 310 | |
| 311 | if (!rsc->setupCheck()) { |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | RsdHal *dc = (RsdHal *)rsc->mHal.drv; |
| 316 | if (!dc->gl.shaderCache->setup(rsc)) { |
| 317 | return; |
| 318 | } |
| 319 | |
| 320 | //ALOGE("Quad"); |
| 321 | //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1); |
| 322 | //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2); |
| 323 | //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3); |
| 324 | //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4); |
| 325 | |
| 326 | float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4}; |
| 327 | const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4}; |
| 328 | |
| 329 | RsdVertexArray::Attrib attribs[2]; |
Tim Murray | e195a3f | 2014-03-13 15:04:58 -0700 | [diff] [blame] | 330 | attribs[0].set(GL_FLOAT, 3, 12, false, (size_t)vtx, "ATTRIB_position"); |
| 331 | attribs[1].set(GL_FLOAT, 2, 8, false, (size_t)tex, "ATTRIB_texture0"); |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 332 | |
| 333 | RsdVertexArray va(attribs, 2); |
| 334 | va.setup(rsc); |
| 335 | |
| 336 | RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | static void SC_DrawQuad(float x1, float y1, float z1, |
| 340 | float x2, float y2, float z2, |
| 341 | float x3, float y3, float z3, |
| 342 | float x4, float y4, float z4) { |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 343 | SC_DrawQuadTexCoords(x1, y1, z1, 0, 1, |
| 344 | x2, y2, z2, 1, 1, |
| 345 | x3, y3, z3, 1, 0, |
| 346 | x4, y4, z4, 0, 0); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | static void SC_DrawSpriteScreenspace(float x, float y, float z, float w, float h) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 350 | Context *rsc = RsdCpuReference::getTlsContext(); |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 351 | |
| 352 | ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex()); |
| 353 | rsc->setProgramVertex(rsc->getDefaultProgramVertex()); |
| 354 | //rsc->setupCheck(); |
| 355 | |
| 356 | //GLint crop[4] = {0, h, w, -h}; |
| 357 | |
| 358 | float sh = rsc->getHeight(); |
| 359 | |
| 360 | SC_DrawQuad(x, sh - y, z, |
| 361 | x+w, sh - y, z, |
| 362 | x+w, sh - (y+h), z, |
| 363 | x, sh - (y+h), z); |
| 364 | rsc->setProgramVertex((ProgramVertex *)tmp.get()); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | static void SC_DrawRect(float x1, float y1, float x2, float y2, float z) { |
Stephen Hines | 414a461 | 2012-09-05 18:05:08 -0700 | [diff] [blame] | 368 | SC_DrawQuad(x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 369 | } |
| 370 | |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 371 | static void SC_DrawPath(Path *p) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 372 | Context *rsc = RsdCpuReference::getTlsContext(); |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 373 | rsdPathDraw(rsc, p); |
| 374 | } |
| 375 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 376 | static void SC_DrawMesh(Mesh *m) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 377 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 378 | rsrDrawMesh(rsc, m); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | static void SC_DrawMeshPrimitive(Mesh *m, uint32_t primIndex) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 382 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 383 | rsrDrawMeshPrimitive(rsc, m, primIndex); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | static void SC_DrawMeshPrimitiveRange(Mesh *m, uint32_t primIndex, uint32_t start, uint32_t len) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 387 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 388 | rsrDrawMeshPrimitiveRange(rsc, m, primIndex, start, len); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | static void SC_MeshComputeBoundingBox(Mesh *m, |
| 392 | float *minX, float *minY, float *minZ, |
| 393 | float *maxX, float *maxY, float *maxZ) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 394 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 395 | rsrMeshComputeBoundingBox(rsc, m, minX, minY, minZ, maxX, maxY, maxZ); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | |
| 399 | |
| 400 | ////////////////////////////////////////////////////////////////////////////// |
| 401 | // |
| 402 | ////////////////////////////////////////////////////////////////////////////// |
| 403 | |
| 404 | |
| 405 | static void SC_Color(float r, float g, float b, float a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 406 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 407 | rsrColor(rsc, r, g, b, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 408 | } |
| 409 | |
| 410 | static void SC_Finish() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 411 | Context *rsc = RsdCpuReference::getTlsContext(); |
Alex Sakhartchouk | 653b53e | 2012-02-24 14:22:34 -0800 | [diff] [blame] | 412 | rsdGLFinish(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 413 | } |
| 414 | |
| 415 | static void SC_ClearColor(float r, float g, float b, float a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 416 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 417 | rsrPrepareClear(rsc); |
Alex Sakhartchouk | 653b53e | 2012-02-24 14:22:34 -0800 | [diff] [blame] | 418 | rsdGLClearColor(rsc, r, g, b, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 419 | } |
| 420 | |
| 421 | static void SC_ClearDepth(float v) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 422 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 423 | rsrPrepareClear(rsc); |
Alex Sakhartchouk | 653b53e | 2012-02-24 14:22:34 -0800 | [diff] [blame] | 424 | rsdGLClearDepth(rsc, v); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 425 | } |
| 426 | |
| 427 | static uint32_t SC_GetWidth() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 428 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 429 | return rsrGetWidth(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 430 | } |
| 431 | |
| 432 | static uint32_t SC_GetHeight() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 433 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 434 | return rsrGetHeight(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | static void SC_DrawTextAlloc(Allocation *a, int x, int y) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 438 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 439 | rsrDrawTextAlloc(rsc, a, x, y); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 440 | } |
| 441 | |
| 442 | static void SC_DrawText(const char *text, int x, int y) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 443 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 444 | rsrDrawText(rsc, text, x, y); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | static void SC_MeasureTextAlloc(Allocation *a, |
| 448 | int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 449 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 450 | rsrMeasureTextAlloc(rsc, a, left, right, top, bottom); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 451 | } |
| 452 | |
| 453 | static void SC_MeasureText(const char *text, |
| 454 | int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 455 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 456 | rsrMeasureText(rsc, text, left, right, top, bottom); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | static void SC_BindFont(Font *f) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 460 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 461 | rsrBindFont(rsc, f); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 462 | } |
| 463 | |
| 464 | static void SC_FontColor(float r, float g, float b, float a) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 465 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 466 | rsrFontColor(rsc, r, g, b, a); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 467 | } |
Jason Sams | 110f181 | 2013-03-14 16:02:18 -0700 | [diff] [blame] | 468 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 469 | |
| 470 | |
| 471 | ////////////////////////////////////////////////////////////////////////////// |
| 472 | // |
| 473 | ////////////////////////////////////////////////////////////////////////////// |
| 474 | |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 475 | static void SC_ClearObject(rs_object_base *dst) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 476 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 477 | rsrClearObject(rsc, dst); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 478 | } |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 479 | #ifndef RS_COMPATIBILITY_LIB |
| 480 | static void SC_SetObject(rs_object_base *dst, rs_object_base src) { |
| 481 | // ALOGE("SC_SetObject: dst = %p, src = %p", dst, src.p); |
| 482 | // ALOGE("SC_SetObject: dst[0] = %p", dst[0]); |
| 483 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 484 | rsrSetObject(rsc, dst, (ObjectBase*)src.p); |
| 485 | } |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 486 | |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 487 | #ifdef __LP64__ |
| 488 | static void SC_SetObject_ByRef(rs_object_base *dst, rs_object_base *src) { |
| 489 | // ALOGE("SC_SetObject2: dst = %p, src = %p", dst, src->p); |
| 490 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 491 | rsrSetObject(rsc, dst, (ObjectBase*)src->p); |
| 492 | } |
| 493 | #endif |
| 494 | |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 495 | static bool SC_IsObject(rs_object_base o) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 496 | Context *rsc = RsdCpuReference::getTlsContext(); |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 497 | return rsrIsObject(rsc, o); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 498 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 499 | |
| 500 | #ifdef __LP64__ |
| 501 | static bool SC_IsObject_ByRef(rs_object_base *o) { |
| 502 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 503 | return rsrIsObject(rsc, *o); |
| 504 | } |
| 505 | #endif |
| 506 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 507 | #else |
| 508 | static void SC_SetObject(rs_object_base *dst, ObjectBase* src) { |
| 509 | // ALOGE("SC_SetObject: dst = %p, src = %p", dst, src.p); |
| 510 | // ALOGE("SC_SetObject: dst[0] = %p", dst[0]); |
| 511 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 512 | rsrSetObject(rsc, dst, src); |
| 513 | } |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 514 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 515 | static bool SC_IsObject(ObjectBase* o) { |
| 516 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 517 | return rsrIsObject(rsc, o); |
| 518 | } |
| 519 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 520 | |
| 521 | |
| 522 | |
| 523 | static const Allocation * SC_GetAllocation(const void *ptr) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 524 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 525 | const Script *sc = RsdCpuReference::getTlsScript(); |
Jason Sams | 807fdc4 | 2012-07-25 17:55:39 -0700 | [diff] [blame] | 526 | return rsdScriptGetAllocationForPointer(rsc, sc, ptr); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 527 | } |
| 528 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 529 | #ifndef RS_COMPATIBILITY_LIB |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 530 | #ifndef __LP64__ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 531 | static void SC_ForEach_SAA(android::renderscript::rs_script target, |
| 532 | android::renderscript::rs_allocation in, |
| 533 | android::renderscript::rs_allocation out) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 534 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 535 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, NULL, 0, NULL); |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 536 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 537 | #else |
| 538 | static void SC_ForEach_SAA(android::renderscript::rs_script *target, |
| 539 | android::renderscript::rs_allocation *in, |
| 540 | android::renderscript::rs_allocation *out) { |
| 541 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 542 | rsrForEach(rsc, (Script*)target->p, (Allocation*)in->p, (Allocation*)out->p, NULL, 0, NULL); |
| 543 | } |
| 544 | #endif |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 545 | |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 546 | #ifndef __LP64__ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 547 | static void SC_ForEach_SAAU(android::renderscript::rs_script target, |
| 548 | android::renderscript::rs_allocation in, |
| 549 | android::renderscript::rs_allocation out, |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 550 | const void *usr) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 551 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 552 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, 0, NULL); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 553 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 554 | #else |
| 555 | static void SC_ForEach_SAAU(android::renderscript::rs_script *target, |
| 556 | android::renderscript::rs_allocation *in, |
| 557 | android::renderscript::rs_allocation *out, |
| 558 | const void *usr) { |
| 559 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 560 | rsrForEach(rsc, (Script*)target->p, (Allocation*)in->p, (Allocation*)out->p, usr, 0, NULL); |
| 561 | } |
| 562 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 563 | |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 564 | #ifndef __LP64__ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 565 | static void SC_ForEach_SAAUS(android::renderscript::rs_script target, |
| 566 | android::renderscript::rs_allocation in, |
| 567 | android::renderscript::rs_allocation out, |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 568 | const void *usr, |
| 569 | const RsScriptCall *call) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 570 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 571 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, 0, call); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 572 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 573 | #else |
| 574 | static void SC_ForEach_SAAUS(android::renderscript::rs_script *target, |
| 575 | android::renderscript::rs_allocation *in, |
| 576 | android::renderscript::rs_allocation *out, |
| 577 | const void *usr, |
| 578 | const RsScriptCall *call) { |
| 579 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 580 | rsrForEach(rsc, (Script*)target->p, (Allocation*)in->p, (Allocation*)out->p, usr, 0, call); |
| 581 | } |
| 582 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 583 | |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 584 | #ifndef __LP64__ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 585 | static void SC_ForEach_SAAUL(android::renderscript::rs_script target, |
| 586 | android::renderscript::rs_allocation in, |
| 587 | android::renderscript::rs_allocation out, |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 588 | const void *usr, |
| 589 | uint32_t usrLen) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 590 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 591 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen, NULL); |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 592 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 593 | #else |
| 594 | static void SC_ForEach_SAAUL(android::renderscript::rs_script *target, |
| 595 | android::renderscript::rs_allocation *in, |
| 596 | android::renderscript::rs_allocation *out, |
| 597 | const void *usr, |
| 598 | uint32_t usrLen) { |
| 599 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 600 | rsrForEach(rsc, (Script*)target->p, (Allocation*)in->p, (Allocation*)out->p, usr, usrLen, NULL); |
| 601 | } |
| 602 | #endif |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 603 | |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 604 | #ifndef __LP64__ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 605 | static void SC_ForEach_SAAULS(android::renderscript::rs_script target, |
| 606 | android::renderscript::rs_allocation in, |
| 607 | android::renderscript::rs_allocation out, |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 608 | const void *usr, |
| 609 | uint32_t usrLen, |
| 610 | const RsScriptCall *call) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 611 | Context *rsc = RsdCpuReference::getTlsContext(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 612 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen, call); |
Jason Sams | c500e74 | 2011-07-25 12:58:37 -0700 | [diff] [blame] | 613 | } |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 614 | #else |
| 615 | static void SC_ForEach_SAAULS(android::renderscript::rs_script *target, |
| 616 | android::renderscript::rs_allocation *in, |
| 617 | android::renderscript::rs_allocation *out, |
| 618 | const void *usr, |
| 619 | uint32_t usrLen, |
| 620 | const RsScriptCall *call) { |
| 621 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 622 | rsrForEach(rsc, (Script*)target->p, (Allocation*)in->p, (Allocation*)out->p, usr, usrLen, call); |
| 623 | } |
| 624 | #endif |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 625 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 626 | |
| 627 | |
| 628 | ////////////////////////////////////////////////////////////////////////////// |
| 629 | // Time routines |
| 630 | ////////////////////////////////////////////////////////////////////////////// |
| 631 | |
| 632 | static float SC_GetDt() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 633 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 634 | const Script *sc = RsdCpuReference::getTlsScript(); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 635 | return rsrGetDt(rsc, sc); |
| 636 | } |
| 637 | |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 638 | #ifndef RS_COMPATIBILITY_LIB |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 639 | time_t SC_Time(time_t *timer) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 640 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 641 | return rsrTime(rsc, timer); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 642 | } |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 643 | #else |
| 644 | static int SC_Time(int *timer) { |
| 645 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 646 | return rsrTime(rsc, (long*)timer); |
| 647 | } |
| 648 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 649 | |
| 650 | tm* SC_LocalTime(tm *local, time_t *timer) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 651 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 652 | return rsrLocalTime(rsc, local, timer); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 653 | } |
| 654 | |
| 655 | int64_t SC_UptimeMillis() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 656 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 657 | return rsrUptimeMillis(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 658 | } |
| 659 | |
| 660 | int64_t SC_UptimeNanos() { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 661 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 662 | return rsrUptimeNanos(rsc); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 663 | } |
| 664 | |
| 665 | ////////////////////////////////////////////////////////////////////////////// |
| 666 | // Message routines |
| 667 | ////////////////////////////////////////////////////////////////////////////// |
| 668 | |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 669 | static uint32_t SC_ToClient2(int cmdID, const void *data, uint32_t len) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 670 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 671 | return rsrToClient(rsc, cmdID, data, len); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | static uint32_t SC_ToClient(int cmdID) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 675 | Context *rsc = RsdCpuReference::getTlsContext(); |
Stephen Hines | 70537f5 | 2013-12-03 16:44:44 -0800 | [diff] [blame] | 676 | return rsrToClient(rsc, cmdID, (const void *)NULL, 0); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 677 | } |
| 678 | |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 679 | static uint32_t SC_ToClientBlocking2(int cmdID, const void *data, uint32_t len) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 680 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 681 | return rsrToClientBlocking(rsc, cmdID, data, len); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | static uint32_t SC_ToClientBlocking(int cmdID) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 685 | Context *rsc = RsdCpuReference::getTlsContext(); |
Stephen Hines | 70537f5 | 2013-12-03 16:44:44 -0800 | [diff] [blame] | 686 | return rsrToClientBlocking(rsc, cmdID, (const void *)NULL, 0); |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 687 | } |
| 688 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 689 | |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 690 | static void * ElementAt1D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x) { |
| 691 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 692 | const Type *t = a->getType(); |
| 693 | const Element *e = t->getElement(); |
| 694 | |
| 695 | char buf[256]; |
| 696 | if (x >= t->getLODDimX(0)) { |
| 697 | sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 698 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 699 | return NULL; |
| 700 | } |
| 701 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 702 | if (vecSize > 0) { |
| 703 | if (vecSize != e->getVectorSize()) { |
| 704 | sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 705 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 706 | return NULL; |
| 707 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 708 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 709 | if (dt != e->getType()) { |
| 710 | sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 711 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 712 | return NULL; |
| 713 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr; |
| 717 | const uint32_t eSize = e->getSizeBytes(); |
| 718 | return &p[(eSize * x)]; |
| 719 | } |
| 720 | |
| 721 | static void * ElementAt2D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y) { |
| 722 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 723 | const Type *t = a->getType(); |
| 724 | const Element *e = t->getElement(); |
| 725 | |
| 726 | char buf[256]; |
| 727 | if (x >= t->getLODDimX(0)) { |
| 728 | sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 729 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 730 | return NULL; |
| 731 | } |
| 732 | |
| 733 | if (y >= t->getLODDimY(0)) { |
| 734 | sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 735 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 736 | return NULL; |
| 737 | } |
| 738 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 739 | if (vecSize > 0) { |
| 740 | if (vecSize != e->getVectorSize()) { |
| 741 | sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 742 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 743 | return NULL; |
| 744 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 745 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 746 | if (dt != e->getType()) { |
| 747 | sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 748 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 749 | return NULL; |
| 750 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 751 | } |
| 752 | |
| 753 | uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr; |
| 754 | const uint32_t eSize = e->getSizeBytes(); |
| 755 | const uint32_t stride = a->mHal.drvState.lod[0].stride; |
| 756 | return &p[(eSize * x) + (y * stride)]; |
| 757 | } |
| 758 | |
| 759 | static void * ElementAt3D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y, uint32_t z) { |
| 760 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 761 | const Type *t = a->getType(); |
| 762 | const Element *e = t->getElement(); |
| 763 | |
| 764 | char buf[256]; |
| 765 | if (x >= t->getLODDimX(0)) { |
| 766 | sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 767 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 768 | return NULL; |
| 769 | } |
| 770 | |
| 771 | if (y >= t->getLODDimY(0)) { |
| 772 | sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 773 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 774 | return NULL; |
| 775 | } |
| 776 | |
| 777 | if (z >= t->getLODDimZ(0)) { |
| 778 | sprintf(buf, "Out range ElementAt Z %i of %i", z, t->getLODDimZ(0)); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 779 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 780 | return NULL; |
| 781 | } |
| 782 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 783 | if (vecSize > 0) { |
| 784 | if (vecSize != e->getVectorSize()) { |
| 785 | sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 786 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 787 | return NULL; |
| 788 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 789 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 790 | if (dt != e->getType()) { |
| 791 | sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType()); |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 792 | rsc->setError(RS_ERROR_FATAL_DEBUG, buf); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 793 | return NULL; |
| 794 | } |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 795 | } |
| 796 | |
| 797 | uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr; |
| 798 | const uint32_t eSize = e->getSizeBytes(); |
| 799 | const uint32_t stride = a->mHal.drvState.lod[0].stride; |
| 800 | return &p[(eSize * x) + (y * stride)]; |
| 801 | } |
| 802 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 803 | static const void * SC_GetElementAt1D(android::renderscript::rs_allocation a, uint32_t x) { |
| 804 | return ElementAt1D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 805 | } |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 806 | static const void * SC_GetElementAt2D(android::renderscript::rs_allocation a, uint32_t x, uint32_t y) { |
| 807 | return ElementAt2D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x, y); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 808 | } |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 809 | static const void * SC_GetElementAt3D(android::renderscript::rs_allocation a, uint32_t x, uint32_t y, uint32_t z) { |
| 810 | return ElementAt3D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x, y, z); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 811 | } |
| 812 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 813 | static void SC_SetElementAt1D(android::renderscript::rs_allocation a, const void *ptr, uint32_t x) { |
| 814 | const Type *t = ((Allocation*)a.p)->getType(); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 815 | const Element *e = t->getElement(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 816 | void *tmp = ElementAt1D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 817 | if (tmp != NULL) { |
| 818 | memcpy(tmp, ptr, e->getSizeBytes()); |
| 819 | } |
| 820 | } |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 821 | static void SC_SetElementAt2D(android::renderscript::rs_allocation a, const void *ptr, uint32_t x, uint32_t y) { |
| 822 | const Type *t = ((Allocation*)a.p)->getType(); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 823 | const Element *e = t->getElement(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 824 | void *tmp = ElementAt2D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x, y); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 825 | if (tmp != NULL) { |
| 826 | memcpy(tmp, ptr, e->getSizeBytes()); |
| 827 | } |
| 828 | } |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 829 | static void SC_SetElementAt3D(android::renderscript::rs_allocation a, const void *ptr, uint32_t x, uint32_t y, uint32_t z) { |
| 830 | const Type *t = ((Allocation*)a.p)->getType(); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 831 | const Element *e = t->getElement(); |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 832 | void *tmp = ElementAt3D((Allocation*)a.p, RS_TYPE_UNSIGNED_8, 0, x, y, z); |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 833 | if (tmp != NULL) { |
| 834 | memcpy(tmp, ptr, e->getSizeBytes()); |
| 835 | } |
| 836 | } |
| 837 | |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 838 | #define ELEMENT_AT(T, DT, VS) \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 839 | static void SC_SetElementAt1_##T(android::renderscript::rs_allocation a, const T *val, uint32_t x) { \ |
| 840 | void *r = ElementAt1D((Allocation*)a.p, DT, VS, x); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 841 | if (r != NULL) ((T *)r)[0] = *val; \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 842 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
| 843 | } \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 844 | static void SC_SetElementAt2_##T(android::renderscript::rs_allocation a, const T * val, uint32_t x, uint32_t y) { \ |
| 845 | void *r = ElementAt2D((Allocation*)a.p, DT, VS, x, y); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 846 | if (r != NULL) ((T *)r)[0] = *val; \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 847 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
| 848 | } \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 849 | static void SC_SetElementAt3_##T(android::renderscript::rs_allocation a, const T * val, uint32_t x, uint32_t y, uint32_t z) { \ |
| 850 | void *r = ElementAt3D((Allocation*)a.p, DT, VS, x, y, z); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 851 | if (r != NULL) ((T *)r)[0] = *val; \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 852 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
| 853 | } \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 854 | static void SC_GetElementAt1_##T(android::renderscript::rs_allocation a, T *val, uint32_t x) { \ |
| 855 | void *r = ElementAt1D((Allocation*)a.p, DT, VS, x); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 856 | if (r != NULL) *val = ((T *)r)[0]; \ |
| 857 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 858 | } \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 859 | static void SC_GetElementAt2_##T(android::renderscript::rs_allocation a, T *val, uint32_t x, uint32_t y) { \ |
| 860 | void *r = ElementAt2D((Allocation*)a.p, DT, VS, x, y); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 861 | if (r != NULL) *val = ((T *)r)[0]; \ |
| 862 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 863 | } \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 864 | static void SC_GetElementAt3_##T(android::renderscript::rs_allocation a, T *val, uint32_t x, uint32_t y, uint32_t z) { \ |
| 865 | void *r = ElementAt3D((Allocation*)a.p, DT, VS, x, y, z); \ |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 866 | if (r != NULL) *val = ((T *)r)[0]; \ |
| 867 | else ALOGE("Error from %s", __PRETTY_FUNCTION__); \ |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 868 | } |
| 869 | |
| 870 | ELEMENT_AT(char, RS_TYPE_SIGNED_8, 1) |
| 871 | ELEMENT_AT(char2, RS_TYPE_SIGNED_8, 2) |
| 872 | ELEMENT_AT(char3, RS_TYPE_SIGNED_8, 3) |
| 873 | ELEMENT_AT(char4, RS_TYPE_SIGNED_8, 4) |
| 874 | ELEMENT_AT(uchar, RS_TYPE_UNSIGNED_8, 1) |
| 875 | ELEMENT_AT(uchar2, RS_TYPE_UNSIGNED_8, 2) |
| 876 | ELEMENT_AT(uchar3, RS_TYPE_UNSIGNED_8, 3) |
| 877 | ELEMENT_AT(uchar4, RS_TYPE_UNSIGNED_8, 4) |
| 878 | ELEMENT_AT(short, RS_TYPE_SIGNED_16, 1) |
| 879 | ELEMENT_AT(short2, RS_TYPE_SIGNED_16, 2) |
| 880 | ELEMENT_AT(short3, RS_TYPE_SIGNED_16, 3) |
| 881 | ELEMENT_AT(short4, RS_TYPE_SIGNED_16, 4) |
| 882 | ELEMENT_AT(ushort, RS_TYPE_UNSIGNED_16, 1) |
| 883 | ELEMENT_AT(ushort2, RS_TYPE_UNSIGNED_16, 2) |
| 884 | ELEMENT_AT(ushort3, RS_TYPE_UNSIGNED_16, 3) |
| 885 | ELEMENT_AT(ushort4, RS_TYPE_UNSIGNED_16, 4) |
| 886 | ELEMENT_AT(int, RS_TYPE_SIGNED_32, 1) |
| 887 | ELEMENT_AT(int2, RS_TYPE_SIGNED_32, 2) |
| 888 | ELEMENT_AT(int3, RS_TYPE_SIGNED_32, 3) |
| 889 | ELEMENT_AT(int4, RS_TYPE_SIGNED_32, 4) |
| 890 | ELEMENT_AT(uint, RS_TYPE_UNSIGNED_32, 1) |
| 891 | ELEMENT_AT(uint2, RS_TYPE_UNSIGNED_32, 2) |
| 892 | ELEMENT_AT(uint3, RS_TYPE_UNSIGNED_32, 3) |
| 893 | ELEMENT_AT(uint4, RS_TYPE_UNSIGNED_32, 4) |
| 894 | ELEMENT_AT(long, RS_TYPE_SIGNED_64, 1) |
| 895 | ELEMENT_AT(long2, RS_TYPE_SIGNED_64, 2) |
| 896 | ELEMENT_AT(long3, RS_TYPE_SIGNED_64, 3) |
| 897 | ELEMENT_AT(long4, RS_TYPE_SIGNED_64, 4) |
| 898 | ELEMENT_AT(ulong, RS_TYPE_UNSIGNED_64, 1) |
| 899 | ELEMENT_AT(ulong2, RS_TYPE_UNSIGNED_64, 2) |
| 900 | ELEMENT_AT(ulong3, RS_TYPE_UNSIGNED_64, 3) |
| 901 | ELEMENT_AT(ulong4, RS_TYPE_UNSIGNED_64, 4) |
| 902 | ELEMENT_AT(float, RS_TYPE_FLOAT_32, 1) |
| 903 | ELEMENT_AT(float2, RS_TYPE_FLOAT_32, 2) |
| 904 | ELEMENT_AT(float3, RS_TYPE_FLOAT_32, 3) |
| 905 | ELEMENT_AT(float4, RS_TYPE_FLOAT_32, 4) |
| 906 | ELEMENT_AT(double, RS_TYPE_FLOAT_64, 1) |
| 907 | ELEMENT_AT(double2, RS_TYPE_FLOAT_64, 2) |
| 908 | ELEMENT_AT(double3, RS_TYPE_FLOAT_64, 3) |
| 909 | ELEMENT_AT(double4, RS_TYPE_FLOAT_64, 4) |
| 910 | |
| 911 | #undef ELEMENT_AT |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 912 | |
| 913 | ////////////////////////////////////////////////////////////////////////////// |
| 914 | // Stub implementation |
| 915 | ////////////////////////////////////////////////////////////////////////////// |
| 916 | |
| 917 | // llvm name mangling ref |
| 918 | // <builtin-type> ::= v # void |
| 919 | // ::= b # bool |
| 920 | // ::= c # char |
| 921 | // ::= a # signed char |
| 922 | // ::= h # unsigned char |
| 923 | // ::= s # short |
| 924 | // ::= t # unsigned short |
| 925 | // ::= i # int |
| 926 | // ::= j # unsigned int |
| 927 | // ::= l # long |
| 928 | // ::= m # unsigned long |
| 929 | // ::= x # long long, __int64 |
| 930 | // ::= y # unsigned long long, __int64 |
| 931 | // ::= f # float |
| 932 | // ::= d # double |
| 933 | |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 934 | static RsdCpuReference::CpuSymbol gSyms[] = { |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 935 | // Debug runtime |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 936 | { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_GetElementAt1D, true }, |
| 937 | { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_GetElementAt2D, true }, |
| 938 | { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_GetElementAt3D, true }, |
| 939 | { "_Z14rsSetElementAt13rs_allocationPKvj", (void *)&SC_SetElementAt1D, true }, |
| 940 | { "_Z14rsSetElementAt13rs_allocationPKvjj", (void *)&SC_SetElementAt2D, true }, |
| 941 | { "_Z14rsSetElementAt13rs_allocationPKvjjj", (void *)&SC_SetElementAt3D, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 942 | |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 943 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 944 | { "_Z20rsGetElementAt_uchar13rs_allocationPhj", (void *)&SC_GetElementAt1_uchar, true }, |
| 945 | { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hj", (void *)&SC_GetElementAt1_uchar2, true }, |
| 946 | { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hj", (void *)&SC_GetElementAt1_uchar3, true }, |
| 947 | { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hj", (void *)&SC_GetElementAt1_uchar4, true }, |
| 948 | { "_Z20rsGetElementAt_uchar13rs_allocationPhjj", (void *)&SC_GetElementAt2_uchar, true }, |
| 949 | { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjj", (void *)&SC_GetElementAt2_uchar2, true }, |
| 950 | { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjj", (void *)&SC_GetElementAt2_uchar3, true }, |
| 951 | { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjj", (void *)&SC_GetElementAt2_uchar4, true }, |
| 952 | { "_Z20rsGetElementAt_uchar13rs_allocationPhjjj", (void *)&SC_GetElementAt3_uchar, true }, |
| 953 | { "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjjj", (void *)&SC_GetElementAt3_uchar2, true }, |
| 954 | { "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjjj", (void *)&SC_GetElementAt3_uchar3, true }, |
| 955 | { "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjjj", (void *)&SC_GetElementAt3_uchar4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 956 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 957 | { "_Z19rsGetElementAt_char13rs_allocationPcj", (void *)&SC_GetElementAt1_char, true }, |
| 958 | { "_Z20rsGetElementAt_char213rs_allocationPDv2_cj", (void *)&SC_GetElementAt1_char2, true }, |
| 959 | { "_Z20rsGetElementAt_char313rs_allocationPDv3_cj", (void *)&SC_GetElementAt1_char3, true }, |
| 960 | { "_Z20rsGetElementAt_char413rs_allocationPDv4_cj", (void *)&SC_GetElementAt1_char4, true }, |
| 961 | { "_Z19rsGetElementAt_char13rs_allocationPcjj", (void *)&SC_GetElementAt2_char, true }, |
| 962 | { "_Z20rsGetElementAt_char213rs_allocationPDv2_cjj", (void *)&SC_GetElementAt2_char2, true }, |
| 963 | { "_Z20rsGetElementAt_char313rs_allocationPDv3_cjj", (void *)&SC_GetElementAt2_char3, true }, |
| 964 | { "_Z20rsGetElementAt_char413rs_allocationPDv4_cjj", (void *)&SC_GetElementAt2_char4, true }, |
| 965 | { "_Z19rsGetElementAt_char13rs_allocationPcjjj", (void *)&SC_GetElementAt3_char, true }, |
| 966 | { "_Z20rsGetElementAt_char213rs_allocationPDv2_cjjj", (void *)&SC_GetElementAt3_char2, true }, |
| 967 | { "_Z20rsGetElementAt_char313rs_allocationPDv3_cjjj", (void *)&SC_GetElementAt3_char3, true }, |
| 968 | { "_Z20rsGetElementAt_char413rs_allocationPDv4_cjjj", (void *)&SC_GetElementAt3_char4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 969 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 970 | { "_Z21rsGetElementAt_ushort13rs_allocationPtj", (void *)&SC_GetElementAt1_ushort, true }, |
| 971 | { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tj", (void *)&SC_GetElementAt1_ushort2, true }, |
| 972 | { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tj", (void *)&SC_GetElementAt1_ushort3, true }, |
| 973 | { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tj", (void *)&SC_GetElementAt1_ushort4, true }, |
| 974 | { "_Z21rsGetElementAt_ushort13rs_allocationPtjj", (void *)&SC_GetElementAt2_ushort, true }, |
| 975 | { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjj", (void *)&SC_GetElementAt2_ushort2, true }, |
| 976 | { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjj", (void *)&SC_GetElementAt2_ushort3, true }, |
| 977 | { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjj", (void *)&SC_GetElementAt2_ushort4, true }, |
| 978 | { "_Z21rsGetElementAt_ushort13rs_allocationPtjjj", (void *)&SC_GetElementAt3_ushort, true }, |
| 979 | { "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjjj", (void *)&SC_GetElementAt3_ushort2, true }, |
| 980 | { "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjjj", (void *)&SC_GetElementAt3_ushort3, true }, |
| 981 | { "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjjj", (void *)&SC_GetElementAt3_ushort4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 982 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 983 | { "_Z20rsGetElementAt_short13rs_allocationPsj", (void *)&SC_GetElementAt1_short, true }, |
| 984 | { "_Z21rsGetElementAt_short213rs_allocationPDv2_sj", (void *)&SC_GetElementAt1_short2, true }, |
| 985 | { "_Z21rsGetElementAt_short313rs_allocationPDv3_sj", (void *)&SC_GetElementAt1_short3, true }, |
| 986 | { "_Z21rsGetElementAt_short413rs_allocationPDv4_sj", (void *)&SC_GetElementAt1_short4, true }, |
| 987 | { "_Z20rsGetElementAt_short13rs_allocationPsjj", (void *)&SC_GetElementAt2_short, true }, |
| 988 | { "_Z21rsGetElementAt_short213rs_allocationPDv2_sjj", (void *)&SC_GetElementAt2_short2, true }, |
| 989 | { "_Z21rsGetElementAt_short313rs_allocationPDv3_sjj", (void *)&SC_GetElementAt2_short3, true }, |
| 990 | { "_Z21rsGetElementAt_short413rs_allocationPDv4_sjj", (void *)&SC_GetElementAt2_short4, true }, |
| 991 | { "_Z20rsGetElementAt_short13rs_allocationPsjjj", (void *)&SC_GetElementAt3_short, true }, |
| 992 | { "_Z21rsGetElementAt_short213rs_allocationPDv2_sjjj", (void *)&SC_GetElementAt3_short2, true }, |
| 993 | { "_Z21rsGetElementAt_short313rs_allocationPDv3_sjjj", (void *)&SC_GetElementAt3_short3, true }, |
| 994 | { "_Z21rsGetElementAt_short413rs_allocationPDv4_sjjj", (void *)&SC_GetElementAt3_short4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 995 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 996 | { "_Z19rsGetElementAt_uint13rs_allocationPjj", (void *)&SC_GetElementAt1_uint, true }, |
| 997 | { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jj", (void *)&SC_GetElementAt1_uint2, true }, |
| 998 | { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jj", (void *)&SC_GetElementAt1_uint3, true }, |
| 999 | { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jj", (void *)&SC_GetElementAt1_uint4, true }, |
| 1000 | { "_Z19rsGetElementAt_uint13rs_allocationPjjj", (void *)&SC_GetElementAt2_uint, true }, |
| 1001 | { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjj", (void *)&SC_GetElementAt2_uint2, true }, |
| 1002 | { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjj", (void *)&SC_GetElementAt2_uint3, true }, |
| 1003 | { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjj", (void *)&SC_GetElementAt2_uint4, true }, |
| 1004 | { "_Z19rsGetElementAt_uint13rs_allocationPjjjj", (void *)&SC_GetElementAt3_uint, true }, |
| 1005 | { "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjjj", (void *)&SC_GetElementAt3_uint2, true }, |
| 1006 | { "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjjj", (void *)&SC_GetElementAt3_uint3, true }, |
| 1007 | { "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjjj", (void *)&SC_GetElementAt3_uint4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1008 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1009 | { "_Z18rsGetElementAt_int13rs_allocationPij", (void *)&SC_GetElementAt1_int, true }, |
| 1010 | { "_Z19rsGetElementAt_int213rs_allocationPDv2_ij", (void *)&SC_GetElementAt1_int2, true }, |
| 1011 | { "_Z19rsGetElementAt_int313rs_allocationPDv3_ij", (void *)&SC_GetElementAt1_int3, true }, |
| 1012 | { "_Z19rsGetElementAt_int413rs_allocationPDv4_ij", (void *)&SC_GetElementAt1_int4, true }, |
| 1013 | { "_Z18rsGetElementAt_int13rs_allocationPijj", (void *)&SC_GetElementAt2_int, true }, |
| 1014 | { "_Z19rsGetElementAt_int213rs_allocationPDv2_ijj", (void *)&SC_GetElementAt2_int2, true }, |
| 1015 | { "_Z19rsGetElementAt_int313rs_allocationPDv3_ijj", (void *)&SC_GetElementAt2_int3, true }, |
| 1016 | { "_Z19rsGetElementAt_int413rs_allocationPDv4_ijj", (void *)&SC_GetElementAt2_int4, true }, |
| 1017 | { "_Z18rsGetElementAt_int13rs_allocationPijjj", (void *)&SC_GetElementAt3_int, true }, |
| 1018 | { "_Z19rsGetElementAt_int213rs_allocationPDv2_ijjj", (void *)&SC_GetElementAt3_int2, true }, |
| 1019 | { "_Z19rsGetElementAt_int313rs_allocationPDv3_ijjj", (void *)&SC_GetElementAt3_int3, true }, |
| 1020 | { "_Z19rsGetElementAt_int413rs_allocationPDv4_ijjj", (void *)&SC_GetElementAt3_int4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1021 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1022 | { "_Z20rsGetElementAt_ulong13rs_allocationPmj", (void *)&SC_GetElementAt1_ulong, true }, |
| 1023 | { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mj", (void *)&SC_GetElementAt1_ulong2, true }, |
| 1024 | { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mj", (void *)&SC_GetElementAt1_ulong3, true }, |
| 1025 | { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mj", (void *)&SC_GetElementAt1_ulong4, true }, |
| 1026 | { "_Z20rsGetElementAt_ulong13rs_allocationPmjj", (void *)&SC_GetElementAt2_ulong, true }, |
| 1027 | { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjj", (void *)&SC_GetElementAt2_ulong2, true }, |
| 1028 | { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjj", (void *)&SC_GetElementAt2_ulong3, true }, |
| 1029 | { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjj", (void *)&SC_GetElementAt2_ulong4, true }, |
| 1030 | { "_Z20rsGetElementAt_ulong13rs_allocationPmjjj", (void *)&SC_GetElementAt3_ulong, true }, |
| 1031 | { "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjjj", (void *)&SC_GetElementAt3_ulong2, true }, |
| 1032 | { "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjjj", (void *)&SC_GetElementAt3_ulong3, true }, |
| 1033 | { "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjjj", (void *)&SC_GetElementAt3_ulong4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1034 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1035 | { "_Z19rsGetElementAt_long13rs_allocationPlj", (void *)&SC_GetElementAt1_long, true }, |
| 1036 | { "_Z20rsGetElementAt_long213rs_allocationPDv2_lj", (void *)&SC_GetElementAt1_long2, true }, |
| 1037 | { "_Z20rsGetElementAt_long313rs_allocationPDv3_lj", (void *)&SC_GetElementAt1_long3, true }, |
| 1038 | { "_Z20rsGetElementAt_long413rs_allocationPDv4_lj", (void *)&SC_GetElementAt1_long4, true }, |
| 1039 | { "_Z19rsGetElementAt_long13rs_allocationPljj", (void *)&SC_GetElementAt2_long, true }, |
| 1040 | { "_Z20rsGetElementAt_long213rs_allocationPDv2_ljj", (void *)&SC_GetElementAt2_long2, true }, |
| 1041 | { "_Z20rsGetElementAt_long313rs_allocationPDv3_ljj", (void *)&SC_GetElementAt2_long3, true }, |
| 1042 | { "_Z20rsGetElementAt_long413rs_allocationPDv4_ljj", (void *)&SC_GetElementAt2_long4, true }, |
| 1043 | { "_Z19rsGetElementAt_long13rs_allocationPljjj", (void *)&SC_GetElementAt3_long, true }, |
| 1044 | { "_Z20rsGetElementAt_long213rs_allocationPDv2_ljjj", (void *)&SC_GetElementAt3_long2, true }, |
| 1045 | { "_Z20rsGetElementAt_long313rs_allocationPDv3_ljjj", (void *)&SC_GetElementAt3_long3, true }, |
| 1046 | { "_Z20rsGetElementAt_long413rs_allocationPDv4_ljjj", (void *)&SC_GetElementAt3_long4, true }, |
| 1047 | |
| 1048 | { "_Z20rsGetElementAt_float13rs_allocationPfj", (void *)&SC_GetElementAt1_float, true }, |
| 1049 | { "_Z21rsGetElementAt_float213rs_allocationPDv2_fj", (void *)&SC_GetElementAt1_float2, true }, |
| 1050 | { "_Z21rsGetElementAt_float313rs_allocationPDv3_fj", (void *)&SC_GetElementAt1_float3, true }, |
| 1051 | { "_Z21rsGetElementAt_float413rs_allocationPDv4_fj", (void *)&SC_GetElementAt1_float4, true }, |
| 1052 | { "_Z20rsGetElementAt_float13rs_allocationPfjj", (void *)&SC_GetElementAt2_float, true }, |
| 1053 | { "_Z21rsGetElementAt_float213rs_allocationPDv2_fjj", (void *)&SC_GetElementAt2_float2, true }, |
| 1054 | { "_Z21rsGetElementAt_float313rs_allocationPDv3_fjj", (void *)&SC_GetElementAt2_float3, true }, |
| 1055 | { "_Z21rsGetElementAt_float413rs_allocationPDv4_fjj", (void *)&SC_GetElementAt2_float4, true }, |
| 1056 | { "_Z20rsGetElementAt_float13rs_allocationPfjjj", (void *)&SC_GetElementAt3_float, true }, |
| 1057 | { "_Z21rsGetElementAt_float213rs_allocationPDv2_fjjj", (void *)&SC_GetElementAt3_float2, true }, |
| 1058 | { "_Z21rsGetElementAt_float313rs_allocationPDv3_fjjj", (void *)&SC_GetElementAt3_float3, true }, |
| 1059 | { "_Z21rsGetElementAt_float413rs_allocationPDv4_fjjj", (void *)&SC_GetElementAt3_float4, true }, |
| 1060 | |
| 1061 | { "_Z21rsGetElementAt_double13rs_allocationPdj", (void *)&SC_GetElementAt1_double, true }, |
| 1062 | { "_Z22rsGetElementAt_double213rs_allocationPDv2_dj", (void *)&SC_GetElementAt1_double2, true }, |
| 1063 | { "_Z22rsGetElementAt_double313rs_allocationPDv3_dj", (void *)&SC_GetElementAt1_double3, true }, |
| 1064 | { "_Z22rsGetElementAt_double413rs_allocationPDv4_dj", (void *)&SC_GetElementAt1_double4, true }, |
| 1065 | { "_Z21rsGetElementAt_double13rs_allocationPdjj", (void *)&SC_GetElementAt2_double, true }, |
| 1066 | { "_Z22rsGetElementAt_double213rs_allocationPDv2_djj", (void *)&SC_GetElementAt2_double2, true }, |
| 1067 | { "_Z22rsGetElementAt_double313rs_allocationPDv3_djj", (void *)&SC_GetElementAt2_double3, true }, |
| 1068 | { "_Z22rsGetElementAt_double413rs_allocationPDv4_djj", (void *)&SC_GetElementAt2_double4, true }, |
| 1069 | { "_Z21rsGetElementAt_double13rs_allocationPdjjj", (void *)&SC_GetElementAt3_double, true }, |
| 1070 | { "_Z22rsGetElementAt_double213rs_allocationPDv2_djjj", (void *)&SC_GetElementAt3_double2, true }, |
| 1071 | { "_Z22rsGetElementAt_double313rs_allocationPDv3_djjj", (void *)&SC_GetElementAt3_double3, true }, |
| 1072 | { "_Z22rsGetElementAt_double413rs_allocationPDv4_djjj", (void *)&SC_GetElementAt3_double4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1073 | |
| 1074 | |
| 1075 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1076 | { "_Z20rsSetElementAt_uchar13rs_allocationPKhj", (void *)&SC_SetElementAt1_uchar, true }, |
| 1077 | { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hj", (void *)&SC_SetElementAt1_uchar2, true }, |
| 1078 | { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hj", (void *)&SC_SetElementAt1_uchar3, true }, |
| 1079 | { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hj", (void *)&SC_SetElementAt1_uchar4, true }, |
| 1080 | { "_Z20rsSetElementAt_uchar13rs_allocationPKhjj", (void *)&SC_SetElementAt2_uchar, true }, |
| 1081 | { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjj", (void *)&SC_SetElementAt2_uchar2, true }, |
| 1082 | { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjj", (void *)&SC_SetElementAt2_uchar3, true }, |
| 1083 | { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjj", (void *)&SC_SetElementAt2_uchar4, true }, |
| 1084 | { "_Z20rsSetElementAt_uchar13rs_allocationPKhjjj", (void *)&SC_SetElementAt3_uchar, true }, |
| 1085 | { "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjjj", (void *)&SC_SetElementAt3_uchar2, true }, |
| 1086 | { "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjjj", (void *)&SC_SetElementAt3_uchar3, true }, |
| 1087 | { "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjjj", (void *)&SC_SetElementAt3_uchar4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1088 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1089 | { "_Z19rsSetElementAt_char13rs_allocationPKcj", (void *)&SC_SetElementAt1_char, true }, |
| 1090 | { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cj", (void *)&SC_SetElementAt1_char2, true }, |
| 1091 | { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cj", (void *)&SC_SetElementAt1_char3, true }, |
| 1092 | { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cj", (void *)&SC_SetElementAt1_char4, true }, |
| 1093 | { "_Z19rsSetElementAt_char13rs_allocationPKcjj", (void *)&SC_SetElementAt2_char, true }, |
| 1094 | { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjj", (void *)&SC_SetElementAt2_char2, true }, |
| 1095 | { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjj", (void *)&SC_SetElementAt2_char3, true }, |
| 1096 | { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjj", (void *)&SC_SetElementAt2_char4, true }, |
| 1097 | { "_Z19rsSetElementAt_char13rs_allocationPKcjjj", (void *)&SC_SetElementAt3_char, true }, |
| 1098 | { "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjjj", (void *)&SC_SetElementAt3_char2, true }, |
| 1099 | { "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjjj", (void *)&SC_SetElementAt3_char3, true }, |
| 1100 | { "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjjj", (void *)&SC_SetElementAt3_char4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1101 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1102 | { "_Z21rsSetElementAt_ushort13rs_allocationPKht", (void *)&SC_SetElementAt1_ushort, true }, |
| 1103 | { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tj", (void *)&SC_SetElementAt1_ushort2, true }, |
| 1104 | { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tj", (void *)&SC_SetElementAt1_ushort3, true }, |
| 1105 | { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tj", (void *)&SC_SetElementAt1_ushort4, true }, |
| 1106 | { "_Z21rsSetElementAt_ushort13rs_allocationPKtjj", (void *)&SC_SetElementAt2_ushort, true }, |
| 1107 | { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjj", (void *)&SC_SetElementAt2_ushort2, true }, |
| 1108 | { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjj", (void *)&SC_SetElementAt2_ushort3, true }, |
| 1109 | { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjj", (void *)&SC_SetElementAt2_ushort4, true }, |
| 1110 | { "_Z21rsSetElementAt_ushort13rs_allocationPKtjjj", (void *)&SC_SetElementAt3_ushort, true }, |
| 1111 | { "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjjj", (void *)&SC_SetElementAt3_ushort2, true }, |
| 1112 | { "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjjj", (void *)&SC_SetElementAt3_ushort3, true }, |
| 1113 | { "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjjj", (void *)&SC_SetElementAt3_ushort4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1114 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1115 | { "_Z20rsSetElementAt_short13rs_allocationPKsj", (void *)&SC_SetElementAt1_short, true }, |
| 1116 | { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sj", (void *)&SC_SetElementAt1_short2, true }, |
| 1117 | { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sj", (void *)&SC_SetElementAt1_short3, true }, |
| 1118 | { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sj", (void *)&SC_SetElementAt1_short4, true }, |
| 1119 | { "_Z20rsSetElementAt_short13rs_allocationPKsjj", (void *)&SC_SetElementAt2_short, true }, |
| 1120 | { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjj", (void *)&SC_SetElementAt2_short2, true }, |
| 1121 | { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjj", (void *)&SC_SetElementAt2_short3, true }, |
| 1122 | { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjj", (void *)&SC_SetElementAt2_short4, true }, |
| 1123 | { "_Z20rsSetElementAt_short13rs_allocationPKsjjj", (void *)&SC_SetElementAt3_short, true }, |
| 1124 | { "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjjj", (void *)&SC_SetElementAt3_short2, true }, |
| 1125 | { "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjjj", (void *)&SC_SetElementAt3_short3, true }, |
| 1126 | { "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjjj", (void *)&SC_SetElementAt3_short4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1127 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1128 | { "_Z19rsSetElementAt_uint13rs_allocationPKjj", (void *)&SC_SetElementAt1_uint, true }, |
| 1129 | { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jj", (void *)&SC_SetElementAt1_uint2, true }, |
| 1130 | { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jj", (void *)&SC_SetElementAt1_uint3, true }, |
| 1131 | { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jj", (void *)&SC_SetElementAt1_uint4, true }, |
| 1132 | { "_Z19rsSetElementAt_uint13rs_allocationPKjjj", (void *)&SC_SetElementAt2_uint, true }, |
| 1133 | { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjj", (void *)&SC_SetElementAt2_uint2, true }, |
| 1134 | { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjj", (void *)&SC_SetElementAt2_uint3, true }, |
| 1135 | { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjj", (void *)&SC_SetElementAt2_uint4, true }, |
| 1136 | { "_Z19rsSetElementAt_uint13rs_allocationPKjjjj", (void *)&SC_SetElementAt3_uint, true }, |
| 1137 | { "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjjj", (void *)&SC_SetElementAt3_uint2, true }, |
| 1138 | { "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjjj", (void *)&SC_SetElementAt3_uint3, true }, |
| 1139 | { "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjjj", (void *)&SC_SetElementAt3_uint4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1140 | |
Stephen Hines | cca3d6c | 2013-04-15 01:06:39 -0700 | [diff] [blame] | 1141 | { "_Z18rsSetElementAt_int13rs_allocationPKij", (void *)&SC_SetElementAt1_int, true }, |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1142 | { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ij", (void *)&SC_SetElementAt1_int2, true }, |
| 1143 | { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ij", (void *)&SC_SetElementAt1_int3, true }, |
| 1144 | { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ij", (void *)&SC_SetElementAt1_int4, true }, |
| 1145 | { "_Z18rsSetElementAt_int13rs_allocationPKijj", (void *)&SC_SetElementAt2_int, true }, |
| 1146 | { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijj", (void *)&SC_SetElementAt2_int2, true }, |
| 1147 | { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijj", (void *)&SC_SetElementAt2_int3, true }, |
| 1148 | { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijj", (void *)&SC_SetElementAt2_int4, true }, |
| 1149 | { "_Z18rsSetElementAt_int13rs_allocationPKijjj", (void *)&SC_SetElementAt3_int, true }, |
| 1150 | { "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijjj", (void *)&SC_SetElementAt3_int2, true }, |
| 1151 | { "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijjj", (void *)&SC_SetElementAt3_int3, true }, |
| 1152 | { "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijjj", (void *)&SC_SetElementAt3_int4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1153 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1154 | { "_Z20rsSetElementAt_ulong13rs_allocationPKmt", (void *)&SC_SetElementAt1_ulong, true }, |
| 1155 | { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mj", (void *)&SC_SetElementAt1_ulong2, true }, |
| 1156 | { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mj", (void *)&SC_SetElementAt1_ulong3, true }, |
| 1157 | { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mj", (void *)&SC_SetElementAt1_ulong4, true }, |
| 1158 | { "_Z20rsSetElementAt_ulong13rs_allocationPKmjj", (void *)&SC_SetElementAt2_ulong, true }, |
| 1159 | { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjj", (void *)&SC_SetElementAt2_ulong2, true }, |
| 1160 | { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjj", (void *)&SC_SetElementAt2_ulong3, true }, |
| 1161 | { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjj", (void *)&SC_SetElementAt2_ulong4, true }, |
| 1162 | { "_Z20rsSetElementAt_ulong13rs_allocationPKmjjj", (void *)&SC_SetElementAt3_ulong, true }, |
| 1163 | { "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjjj", (void *)&SC_SetElementAt3_ulong2, true }, |
| 1164 | { "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjjj", (void *)&SC_SetElementAt3_ulong3, true }, |
| 1165 | { "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjjj", (void *)&SC_SetElementAt3_ulong4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1166 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1167 | { "_Z19rsSetElementAt_long13rs_allocationPKlj", (void *)&SC_SetElementAt1_long, true }, |
| 1168 | { "_Z20rsSetElementAt_long213rs_allocationPKDv2_lj", (void *)&SC_SetElementAt1_long2, true }, |
| 1169 | { "_Z20rsSetElementAt_long313rs_allocationPKDv3_lj", (void *)&SC_SetElementAt1_long3, true }, |
| 1170 | { "_Z20rsSetElementAt_long413rs_allocationPKDv4_lj", (void *)&SC_SetElementAt1_long4, true }, |
| 1171 | { "_Z19rsSetElementAt_long13rs_allocationPKljj", (void *)&SC_SetElementAt2_long, true }, |
| 1172 | { "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljj", (void *)&SC_SetElementAt2_long2, true }, |
| 1173 | { "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljj", (void *)&SC_SetElementAt2_long3, true }, |
| 1174 | { "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljj", (void *)&SC_SetElementAt2_long4, true }, |
| 1175 | { "_Z19rsSetElementAt_long13rs_allocationPKljjj", (void *)&SC_SetElementAt3_long, true }, |
| 1176 | { "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljjj", (void *)&SC_SetElementAt3_long2, true }, |
| 1177 | { "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljjj", (void *)&SC_SetElementAt3_long3, true }, |
| 1178 | { "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljjj", (void *)&SC_SetElementAt3_long4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1179 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1180 | { "_Z20rsSetElementAt_float13rs_allocationPKft", (void *)&SC_SetElementAt1_float, true }, |
| 1181 | { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fj", (void *)&SC_SetElementAt1_float2, true }, |
| 1182 | { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fj", (void *)&SC_SetElementAt1_float3, true }, |
| 1183 | { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fj", (void *)&SC_SetElementAt1_float4, true }, |
| 1184 | { "_Z20rsSetElementAt_float13rs_allocationPKfjj", (void *)&SC_SetElementAt2_float, true }, |
| 1185 | { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjj", (void *)&SC_SetElementAt2_float2, true }, |
| 1186 | { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjj", (void *)&SC_SetElementAt2_float3, true }, |
| 1187 | { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjj", (void *)&SC_SetElementAt2_float4, true }, |
| 1188 | { "_Z20rsSetElementAt_float13rs_allocationPKfjjj", (void *)&SC_SetElementAt3_float, true }, |
| 1189 | { "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjjj", (void *)&SC_SetElementAt3_float2, true }, |
| 1190 | { "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjjj", (void *)&SC_SetElementAt3_float3, true }, |
| 1191 | { "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjjj", (void *)&SC_SetElementAt3_float4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1192 | |
Jason Sams | d09b9d6 | 2013-04-02 20:07:04 -0700 | [diff] [blame] | 1193 | { "_Z21rsSetElementAt_double13rs_allocationPKdt", (void *)&SC_SetElementAt1_double, true }, |
| 1194 | { "_Z22rsSetElementAt_double213rs_allocationPKDv2_dj", (void *)&SC_SetElementAt1_double2, true }, |
| 1195 | { "_Z22rsSetElementAt_double313rs_allocationPKDv3_dj", (void *)&SC_SetElementAt1_double3, true }, |
| 1196 | { "_Z22rsSetElementAt_double413rs_allocationPKDv4_dj", (void *)&SC_SetElementAt1_double4, true }, |
| 1197 | { "_Z21rsSetElementAt_double13rs_allocationPKdjj", (void *)&SC_SetElementAt2_double, true }, |
| 1198 | { "_Z22rsSetElementAt_double213rs_allocationPKDv2_djj", (void *)&SC_SetElementAt2_double2, true }, |
| 1199 | { "_Z22rsSetElementAt_double313rs_allocationPKDv3_djj", (void *)&SC_SetElementAt2_double3, true }, |
| 1200 | { "_Z22rsSetElementAt_double413rs_allocationPKDv4_djj", (void *)&SC_SetElementAt2_double4, true }, |
| 1201 | { "_Z21rsSetElementAt_double13rs_allocationPKdjjj", (void *)&SC_SetElementAt3_double, true }, |
| 1202 | { "_Z22rsSetElementAt_double213rs_allocationPKDv2_djjj", (void *)&SC_SetElementAt3_double2, true }, |
| 1203 | { "_Z22rsSetElementAt_double313rs_allocationPKDv3_djjj", (void *)&SC_SetElementAt3_double3, true }, |
| 1204 | { "_Z22rsSetElementAt_double413rs_allocationPKDv4_djjj", (void *)&SC_SetElementAt3_double4, true }, |
Jason Sams | 5261a5e | 2013-02-27 15:46:24 -0800 | [diff] [blame] | 1205 | |
| 1206 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1207 | // Refcounting |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 1208 | #ifndef __LP64__ |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1209 | { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1210 | { "_Z10rsIsObject10rs_element", (void *)&SC_IsObject, true }, |
| 1211 | |
| 1212 | { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1213 | { "_Z10rsIsObject7rs_type", (void *)&SC_IsObject, true }, |
| 1214 | |
| 1215 | { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1216 | { "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject, true }, |
| 1217 | |
| 1218 | { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1219 | { "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject, true }, |
| 1220 | |
| 1221 | { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1222 | { "_Z10rsIsObject9rs_script", (void *)&SC_IsObject, true }, |
Yong Chen | 4e36337 | 2014-08-14 18:28:38 +0800 | [diff] [blame] | 1223 | #else |
| 1224 | { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject_ByRef, true }, |
| 1225 | { "_Z10rsIsObject10rs_element", (void *)&SC_IsObject_ByRef, true }, |
| 1226 | |
| 1227 | { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject_ByRef, true }, |
| 1228 | { "_Z10rsIsObject7rs_type", (void *)&SC_IsObject_ByRef, true }, |
| 1229 | |
| 1230 | { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject_ByRef, true }, |
| 1231 | { "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject_ByRef, true }, |
| 1232 | |
| 1233 | { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject_ByRef, true }, |
| 1234 | { "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject_ByRef, true }, |
| 1235 | |
| 1236 | { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject_ByRef, true }, |
| 1237 | { "_Z10rsIsObject9rs_script", (void *)&SC_IsObject_ByRef, true }, |
| 1238 | #endif |
| 1239 | { "_Z13rsClearObjectP10rs_element", (void *)&SC_ClearObject, true }, |
| 1240 | { "_Z13rsClearObjectP7rs_type", (void *)&SC_ClearObject, true }, |
| 1241 | { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_ClearObject, true }, |
| 1242 | { "_Z13rsClearObjectP10rs_sampler", (void *)&SC_ClearObject, true }, |
| 1243 | { "_Z13rsClearObjectP9rs_script", (void *)&SC_ClearObject, true }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1244 | |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 1245 | { "_Z11rsSetObjectP7rs_pathS_", (void *)&SC_SetObject, true }, |
| 1246 | { "_Z13rsClearObjectP7rs_path", (void *)&SC_ClearObject, true }, |
| 1247 | { "_Z10rsIsObject7rs_path", (void *)&SC_IsObject, true }, |
| 1248 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1249 | { "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_SetObject, true }, |
| 1250 | { "_Z13rsClearObjectP7rs_mesh", (void *)&SC_ClearObject, true }, |
| 1251 | { "_Z10rsIsObject7rs_mesh", (void *)&SC_IsObject, true }, |
| 1252 | |
| 1253 | { "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_SetObject, true }, |
| 1254 | { "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_ClearObject, true }, |
| 1255 | { "_Z10rsIsObject19rs_program_fragment", (void *)&SC_IsObject, true }, |
| 1256 | |
| 1257 | { "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_SetObject, true }, |
| 1258 | { "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_ClearObject, true }, |
| 1259 | { "_Z10rsIsObject17rs_program_vertex", (void *)&SC_IsObject, true }, |
| 1260 | |
| 1261 | { "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_SetObject, true }, |
| 1262 | { "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_ClearObject, true }, |
| 1263 | { "_Z10rsIsObject17rs_program_raster", (void *)&SC_IsObject, true }, |
| 1264 | |
| 1265 | { "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_SetObject, true }, |
| 1266 | { "_Z13rsClearObjectP16rs_program_store", (void *)&SC_ClearObject, true }, |
| 1267 | { "_Z10rsIsObject16rs_program_store", (void *)&SC_IsObject, true }, |
| 1268 | |
| 1269 | { "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_SetObject, true }, |
| 1270 | { "_Z13rsClearObjectP7rs_font", (void *)&SC_ClearObject, true }, |
| 1271 | { "_Z10rsIsObject7rs_font", (void *)&SC_IsObject, true }, |
| 1272 | |
| 1273 | // Allocation ops |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1274 | { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_AllocationSyncAll, true }, |
| 1275 | { "_Z20rsgAllocationSyncAll13rs_allocation", (void *)&SC_AllocationSyncAll, false }, |
| 1276 | { "_Z20rsgAllocationSyncAll13rs_allocationj", (void *)&SC_AllocationSyncAll2, false }, |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 1277 | { "_Z20rsgAllocationSyncAll13rs_allocation24rs_allocation_usage_type", (void *)&SC_AllocationSyncAll2, false }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1278 | { "_Z15rsGetAllocationPKv", (void *)&SC_GetAllocation, true }, |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1279 | #ifndef RS_COMPATIBILITY_LIB |
Jason Sams | b322033 | 2012-04-02 14:41:54 -0700 | [diff] [blame] | 1280 | { "_Z18rsAllocationIoSend13rs_allocation", (void *)&SC_AllocationIoSend, false }, |
| 1281 | { "_Z21rsAllocationIoReceive13rs_allocation", (void *)&SC_AllocationIoReceive, false }, |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1282 | #endif |
Alex Sakhartchouk | 74a8279 | 2011-06-14 11:13:19 -0700 | [diff] [blame] | 1283 | { "_Z23rsAllocationCopy1DRange13rs_allocationjjjS_jj", (void *)&SC_AllocationCopy1DRange, false }, |
| 1284 | { "_Z23rsAllocationCopy2DRange13rs_allocationjjj26rs_allocation_cubemap_facejjS_jjjS0_", (void *)&SC_AllocationCopy2DRange, false }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1285 | |
| 1286 | // Messaging |
| 1287 | |
| 1288 | { "_Z14rsSendToClienti", (void *)&SC_ToClient, false }, |
| 1289 | { "_Z14rsSendToClientiPKvj", (void *)&SC_ToClient2, false }, |
| 1290 | { "_Z22rsSendToClientBlockingi", (void *)&SC_ToClientBlocking, false }, |
| 1291 | { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_ToClientBlocking2, false }, |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1292 | #ifndef RS_COMPATIBILITY_LIB |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1293 | { "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_BindProgramFragment, false }, |
| 1294 | { "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_BindProgramStore, false }, |
| 1295 | { "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_BindProgramVertex, false }, |
| 1296 | { "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_BindProgramRaster, false }, |
| 1297 | { "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_BindSampler, false }, |
| 1298 | { "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_BindTexture, false }, |
Alex Sakhartchouk | a720a14 | 2012-01-10 10:16:52 -0800 | [diff] [blame] | 1299 | { "_Z15rsgBindConstant19rs_program_fragmentj13rs_allocation", (void *)&SC_BindFragmentConstant, false }, |
| 1300 | { "_Z15rsgBindConstant17rs_program_vertexj13rs_allocation", (void *)&SC_BindVertexConstant, false }, |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1301 | |
| 1302 | { "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadProjectionMatrix, false }, |
| 1303 | { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadModelMatrix, false }, |
| 1304 | { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadTextureMatrix, false }, |
| 1305 | |
| 1306 | { "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_VpGetProjectionMatrix, false }, |
| 1307 | |
| 1308 | { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_PfConstantColor, false }, |
| 1309 | |
| 1310 | { "_Z11rsgGetWidthv", (void *)&SC_GetWidth, false }, |
| 1311 | { "_Z12rsgGetHeightv", (void *)&SC_GetHeight, false }, |
| 1312 | |
| 1313 | |
| 1314 | { "_Z11rsgDrawRectfffff", (void *)&SC_DrawRect, false }, |
| 1315 | { "_Z11rsgDrawQuadffffffffffff", (void *)&SC_DrawQuad, false }, |
| 1316 | { "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_DrawQuadTexCoords, false }, |
| 1317 | { "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_DrawSpriteScreenspace, false }, |
| 1318 | |
| 1319 | { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_DrawMesh, false }, |
| 1320 | { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_DrawMeshPrimitive, false }, |
| 1321 | { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_DrawMeshPrimitiveRange, false }, |
| 1322 | { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_MeshComputeBoundingBox, false }, |
| 1323 | |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 1324 | { "_Z11rsgDrawPath7rs_path", (void *)&SC_DrawPath, false }, |
| 1325 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1326 | { "_Z13rsgClearColorffff", (void *)&SC_ClearColor, false }, |
| 1327 | { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth, false }, |
| 1328 | |
| 1329 | { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText, false }, |
| 1330 | { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc, false }, |
| 1331 | { "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText, false }, |
| 1332 | { "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc, false }, |
| 1333 | |
| 1334 | { "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont, false }, |
| 1335 | { "_Z12rsgFontColorffff", (void *)&SC_FontColor, false }, |
| 1336 | |
| 1337 | { "_Z18rsgBindColorTarget13rs_allocationj", (void *)&SC_BindFrameBufferObjectColorTarget, false }, |
| 1338 | { "_Z18rsgBindDepthTarget13rs_allocation", (void *)&SC_BindFrameBufferObjectDepthTarget, false }, |
| 1339 | { "_Z19rsgClearColorTargetj", (void *)&SC_ClearFrameBufferObjectColorTarget, false }, |
| 1340 | { "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false }, |
| 1341 | { "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false }, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1342 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1343 | |
Jason Sams | aa15210 | 2012-06-13 15:16:44 -0700 | [diff] [blame] | 1344 | { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, true }, |
| 1345 | { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, true }, |
Stephen Hines | f598811 | 2012-10-16 00:05:46 -0700 | [diff] [blame] | 1346 | { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK14rs_script_call", (void *)&SC_ForEach_SAAUS, true }, |
Jason Sams | aa15210 | 2012-06-13 15:16:44 -0700 | [diff] [blame] | 1347 | { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, true }, |
Stephen Hines | f598811 | 2012-10-16 00:05:46 -0700 | [diff] [blame] | 1348 | { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK14rs_script_call", (void *)&SC_ForEach_SAAULS, true }, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1349 | #endif // RS_COMPATIBILITY_LIB |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1350 | |
Tim Murray | 785096e | 2014-07-27 13:47:40 -0700 | [diff] [blame] | 1351 | #ifndef __LP64__ |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1352 | // time |
| 1353 | { "_Z6rsTimePi", (void *)&SC_Time, true }, |
| 1354 | { "_Z11rsLocaltimeP5rs_tmPKi", (void *)&SC_LocalTime, true }, |
Tim Murray | 785096e | 2014-07-27 13:47:40 -0700 | [diff] [blame] | 1355 | #else |
| 1356 | // time |
| 1357 | { "_Z6rsTimePl", (void *)&SC_Time, true }, |
| 1358 | { "_Z11rsLocaltimeP5rs_tmPKl", (void *)&SC_LocalTime, true }, |
| 1359 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1360 | { "_Z14rsUptimeMillisv", (void*)&SC_UptimeMillis, true }, |
| 1361 | { "_Z13rsUptimeNanosv", (void*)&SC_UptimeNanos, true }, |
| 1362 | { "_Z7rsGetDtv", (void*)&SC_GetDt, false }, |
| 1363 | |
| 1364 | // misc |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1365 | #ifndef RS_COMPATIBILITY_LIB |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1366 | { "_Z5colorffff", (void *)&SC_Color, false }, |
| 1367 | { "_Z9rsgFinishv", (void *)&SC_Finish, false }, |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1368 | #endif |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1369 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1370 | { NULL, NULL, false } |
| 1371 | }; |
| 1372 | |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1373 | #ifdef RS_COMPATIBILITY_LIB |
| 1374 | |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1375 | ////////////////////////////////////////////////////////////////////////////// |
| 1376 | // Compatibility Library entry points |
| 1377 | ////////////////////////////////////////////////////////////////////////////// |
| 1378 | |
Stephen Hines | f827cad | 2013-11-18 16:47:55 -0800 | [diff] [blame] | 1379 | #define IS_CLEAR_SET_OBJ(t) \ |
| 1380 | bool rsIsObject(t src) { \ |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 1381 | return src.p != NULL; \ |
Stephen Hines | f827cad | 2013-11-18 16:47:55 -0800 | [diff] [blame] | 1382 | } \ |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1383 | void __attribute__((overloadable)) rsClearObject(t *dst) { \ |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 1384 | return SC_ClearObject(reinterpret_cast<rs_object_base *>(dst)); \ |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1385 | } \ |
| 1386 | void __attribute__((overloadable)) rsSetObject(t *dst, t src) { \ |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1387 | return SC_SetObject(reinterpret_cast<rs_object_base *>(dst), (ObjectBase*)src.p); \ |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1388 | } |
| 1389 | |
Jason Sams | 05ef73f | 2014-08-05 14:59:22 -0700 | [diff] [blame] | 1390 | IS_CLEAR_SET_OBJ(::rs_element) |
| 1391 | IS_CLEAR_SET_OBJ(::rs_type) |
| 1392 | IS_CLEAR_SET_OBJ(::rs_allocation) |
| 1393 | IS_CLEAR_SET_OBJ(::rs_sampler) |
| 1394 | IS_CLEAR_SET_OBJ(::rs_script) |
Stephen Hines | f827cad | 2013-11-18 16:47:55 -0800 | [diff] [blame] | 1395 | #undef IS_CLEAR_SET_OBJ |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1396 | |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1397 | static void SC_ForEach_SAA(::rs_script target, |
| 1398 | ::rs_allocation in, |
| 1399 | ::rs_allocation out) { |
| 1400 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 1401 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, NULL, 0, NULL); |
| 1402 | } |
| 1403 | |
| 1404 | static void SC_ForEach_SAAUS(::rs_script target, |
| 1405 | ::rs_allocation in, |
| 1406 | ::rs_allocation out, |
| 1407 | const void *usr, |
| 1408 | const RsScriptCall *call) { |
| 1409 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 1410 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, 0, call); |
| 1411 | } |
| 1412 | |
| 1413 | static void SC_ForEach_SAAUL(::rs_script target, |
| 1414 | ::rs_allocation in, |
| 1415 | ::rs_allocation out, |
| 1416 | const void *usr, |
| 1417 | uint32_t usrLen) { |
| 1418 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 1419 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen, NULL); |
| 1420 | } |
| 1421 | |
| 1422 | static void SC_ForEach_SAAULS(::rs_script target, |
| 1423 | ::rs_allocation in, |
| 1424 | ::rs_allocation out, |
| 1425 | const void *usr, |
| 1426 | uint32_t usrLen, |
| 1427 | const RsScriptCall *call) { |
| 1428 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 1429 | rsrForEach(rsc, (Script*)target.p, (Allocation*)in.p, (Allocation*)out.p, usr, usrLen, call); |
| 1430 | } |
| 1431 | |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1432 | const Allocation * rsGetAllocation(const void *ptr) { |
| 1433 | return SC_GetAllocation(ptr); |
| 1434 | } |
| 1435 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1436 | void __attribute__((overloadable)) rsAllocationIoSend(::rs_allocation a) { |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1437 | SC_AllocationIoSend((Allocation *)a.p); |
| 1438 | } |
| 1439 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1440 | void __attribute__((overloadable)) rsAllocationIoReceive(::rs_allocation a) { |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1441 | SC_AllocationIoReceive((Allocation *)a.p); |
| 1442 | } |
| 1443 | |
| 1444 | |
| 1445 | void __attribute__((overloadable)) rsAllocationCopy1DRange( |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1446 | ::rs_allocation dstAlloc, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1447 | uint32_t dstOff, uint32_t dstMip, uint32_t count, |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1448 | ::rs_allocation srcAlloc, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1449 | uint32_t srcOff, uint32_t srcMip) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1450 | SC_AllocationCopy1DRange(dstAlloc, dstOff, dstMip, count, |
| 1451 | srcAlloc, srcOff, srcMip); |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1452 | } |
| 1453 | |
| 1454 | void __attribute__((overloadable)) rsAllocationCopy2DRange( |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1455 | ::rs_allocation dstAlloc, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1456 | uint32_t dstXoff, uint32_t dstYoff, |
| 1457 | uint32_t dstMip, rs_allocation_cubemap_face dstFace, |
| 1458 | uint32_t width, uint32_t height, |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1459 | ::rs_allocation srcAlloc, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1460 | uint32_t srcXoff, uint32_t srcYoff, |
| 1461 | uint32_t srcMip, rs_allocation_cubemap_face srcFace) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1462 | SC_AllocationCopy2DRange(dstAlloc, dstXoff, dstYoff, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1463 | dstMip, dstFace, width, height, |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1464 | srcAlloc, srcXoff, srcYoff, |
Stephen Hines | 7a01126 | 2013-11-27 14:21:57 -0800 | [diff] [blame] | 1465 | srcMip, srcFace); |
| 1466 | } |
| 1467 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1468 | void __attribute__((overloadable)) rsForEach(::rs_script script, |
| 1469 | ::rs_allocation in, |
| 1470 | ::rs_allocation out, |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1471 | const void *usr, |
| 1472 | const rs_script_call *call) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1473 | return SC_ForEach_SAAUS(script, in, out, usr, (RsScriptCall*)call); |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1474 | } |
| 1475 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1476 | void __attribute__((overloadable)) rsForEach(::rs_script script, |
| 1477 | ::rs_allocation in, |
| 1478 | ::rs_allocation out) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1479 | return SC_ForEach_SAA(script, in, out); |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 1480 | } |
| 1481 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1482 | void __attribute__((overloadable)) rsForEach(::rs_script script, |
| 1483 | ::rs_allocation in, |
| 1484 | ::rs_allocation out, |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 1485 | const void *usr, |
| 1486 | uint32_t usrLen) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1487 | return SC_ForEach_SAAUL(script, in, out, usr, usrLen); |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 1488 | } |
| 1489 | |
Jason Sams | a36c50a | 2014-06-17 12:06:06 -0700 | [diff] [blame] | 1490 | void __attribute__((overloadable)) rsForEach(::rs_script script, |
| 1491 | ::rs_allocation in, |
| 1492 | ::rs_allocation out, |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1493 | const void *usr, |
| 1494 | uint32_t usrLen, |
| 1495 | const rs_script_call *call) { |
Tim Murray | 6a45ddb | 2014-08-06 11:49:02 -0700 | [diff] [blame] | 1496 | return SC_ForEach_SAAULS(script, in, out, usr, usrLen, (RsScriptCall*)call); |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1497 | } |
| 1498 | |
| 1499 | int rsTime(int *timer) { |
| 1500 | return SC_Time(timer); |
| 1501 | } |
| 1502 | |
| 1503 | rs_tm* rsLocaltime(rs_tm* local, const int *timer) { |
| 1504 | return (rs_tm*)(SC_LocalTime((tm*)local, (long*)timer)); |
| 1505 | } |
| 1506 | |
| 1507 | int64_t rsUptimeMillis() { |
| 1508 | Context *rsc = RsdCpuReference::getTlsContext(); |
| 1509 | return rsrUptimeMillis(rsc); |
| 1510 | } |
| 1511 | |
Stephen Hines | cadee38 | 2013-12-12 13:21:00 -0800 | [diff] [blame] | 1512 | int64_t rsUptimeNanos() { |
| 1513 | return SC_UptimeNanos(); |
| 1514 | } |
| 1515 | |
| 1516 | float rsGetDt() { |
| 1517 | return SC_GetDt(); |
| 1518 | } |
| 1519 | |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 1520 | uint32_t rsSendToClient(int cmdID) { |
| 1521 | return SC_ToClient(cmdID); |
| 1522 | } |
| 1523 | |
| 1524 | uint32_t rsSendToClient(int cmdID, const void *data, uint32_t len) { |
| 1525 | return SC_ToClient2(cmdID, data, len); |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1526 | } |
| 1527 | |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1528 | uint32_t rsSendToClientBlocking(int cmdID) { |
Stephen Hines | 276000a | 2013-12-03 09:33:32 -0800 | [diff] [blame] | 1529 | return SC_ToClientBlocking(cmdID); |
| 1530 | } |
| 1531 | |
| 1532 | uint32_t rsSendToClientBlocking(int cmdID, const void *data, uint32_t len) { |
| 1533 | return SC_ToClientBlocking2(cmdID, data, len); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1534 | } |
| 1535 | |
| 1536 | static void SC_debugF(const char *s, float f) { |
| 1537 | ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f))); |
| 1538 | } |
| 1539 | static void SC_debugFv2(const char *s, float f1, float f2) { |
| 1540 | ALOGD("%s {%f, %f}", s, f1, f2); |
| 1541 | } |
| 1542 | static void SC_debugFv3(const char *s, float f1, float f2, float f3) { |
| 1543 | ALOGD("%s {%f, %f, %f}", s, f1, f2, f3); |
| 1544 | } |
| 1545 | static void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) { |
| 1546 | ALOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4); |
| 1547 | } |
| 1548 | static void SC_debugF2(const char *s, float2 f) { |
| 1549 | ALOGD("%s {%f, %f}", s, f.x, f.y); |
| 1550 | } |
| 1551 | static void SC_debugF3(const char *s, float3 f) { |
| 1552 | ALOGD("%s {%f, %f, %f}", s, f.x, f.y, f.z); |
| 1553 | } |
| 1554 | static void SC_debugF4(const char *s, float4 f) { |
| 1555 | ALOGD("%s {%f, %f, %f, %f}", s, f.x, f.y, f.z, f.w); |
| 1556 | } |
| 1557 | static void SC_debugD(const char *s, double d) { |
| 1558 | ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d))); |
| 1559 | } |
| 1560 | static void SC_debugFM4v4(const char *s, const float *f) { |
| 1561 | ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]); |
| 1562 | ALOGD("%s %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]); |
| 1563 | ALOGD("%s %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]); |
| 1564 | ALOGD("%s %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]); |
| 1565 | } |
| 1566 | static void SC_debugFM3v3(const char *s, const float *f) { |
| 1567 | ALOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]); |
| 1568 | ALOGD("%s %f, %f, %f", s, f[1], f[4], f[7]); |
| 1569 | ALOGD("%s %f, %f, %f}",s, f[2], f[5], f[8]); |
| 1570 | } |
| 1571 | static void SC_debugFM2v2(const char *s, const float *f) { |
| 1572 | ALOGD("%s {%f, %f", s, f[0], f[2]); |
| 1573 | ALOGD("%s %f, %f}",s, f[1], f[3]); |
| 1574 | } |
| 1575 | static void SC_debugI8(const char *s, char c) { |
| 1576 | ALOGD("%s %hhd 0x%hhx", s, c, (unsigned char)c); |
| 1577 | } |
| 1578 | static void SC_debugC2(const char *s, char2 c) { |
| 1579 | ALOGD("%s {%hhd, %hhd} 0x%hhx 0x%hhx", s, c.x, c.y, (unsigned char)c.x, (unsigned char)c.y); |
| 1580 | } |
| 1581 | static void SC_debugC3(const char *s, char3 c) { |
| 1582 | 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); |
| 1583 | } |
| 1584 | static void SC_debugC4(const char *s, char4 c) { |
| 1585 | 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); |
| 1586 | } |
| 1587 | static void SC_debugU8(const char *s, unsigned char c) { |
| 1588 | ALOGD("%s %hhu 0x%hhx", s, c, c); |
| 1589 | } |
| 1590 | static void SC_debugUC2(const char *s, uchar2 c) { |
| 1591 | ALOGD("%s {%hhu, %hhu} 0x%hhx 0x%hhx", s, c.x, c.y, c.x, c.y); |
| 1592 | } |
| 1593 | static void SC_debugUC3(const char *s, uchar3 c) { |
| 1594 | ALOGD("%s {%hhu, %hhu, %hhu} 0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, c.x, c.y, c.z); |
| 1595 | } |
| 1596 | static void SC_debugUC4(const char *s, uchar4 c) { |
| 1597 | 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); |
| 1598 | } |
| 1599 | static void SC_debugI16(const char *s, short c) { |
| 1600 | ALOGD("%s %hd 0x%hx", s, c, c); |
| 1601 | } |
| 1602 | static void SC_debugS2(const char *s, short2 c) { |
| 1603 | ALOGD("%s {%hd, %hd} 0x%hx 0x%hx", s, c.x, c.y, c.x, c.y); |
| 1604 | } |
| 1605 | static void SC_debugS3(const char *s, short3 c) { |
| 1606 | ALOGD("%s {%hd, %hd, %hd} 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z); |
| 1607 | } |
| 1608 | static void SC_debugS4(const char *s, short4 c) { |
| 1609 | 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); |
| 1610 | } |
| 1611 | static void SC_debugU16(const char *s, unsigned short c) { |
| 1612 | ALOGD("%s %hu 0x%hx", s, c, c); |
| 1613 | } |
| 1614 | static void SC_debugUS2(const char *s, ushort2 c) { |
| 1615 | ALOGD("%s {%hu, %hu} 0x%hx 0x%hx", s, c.x, c.y, c.x, c.y); |
| 1616 | } |
| 1617 | static void SC_debugUS3(const char *s, ushort3 c) { |
| 1618 | ALOGD("%s {%hu, %hu, %hu} 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z); |
| 1619 | } |
| 1620 | static void SC_debugUS4(const char *s, ushort4 c) { |
| 1621 | 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); |
| 1622 | } |
| 1623 | static void SC_debugI32(const char *s, int32_t i) { |
| 1624 | ALOGD("%s %d 0x%x", s, i, i); |
| 1625 | } |
| 1626 | static void SC_debugI2(const char *s, int2 i) { |
| 1627 | ALOGD("%s {%d, %d} 0x%x 0x%x", s, i.x, i.y, i.x, i.y); |
| 1628 | } |
| 1629 | static void SC_debugI3(const char *s, int3 i) { |
| 1630 | ALOGD("%s {%d, %d, %d} 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z); |
| 1631 | } |
| 1632 | static void SC_debugI4(const char *s, int4 i) { |
| 1633 | 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); |
| 1634 | } |
| 1635 | static void SC_debugU32(const char *s, uint32_t i) { |
| 1636 | ALOGD("%s %u 0x%x", s, i, i); |
| 1637 | } |
| 1638 | static void SC_debugUI2(const char *s, uint2 i) { |
| 1639 | ALOGD("%s {%u, %u} 0x%x 0x%x", s, i.x, i.y, i.x, i.y); |
| 1640 | } |
| 1641 | static void SC_debugUI3(const char *s, uint3 i) { |
| 1642 | ALOGD("%s {%u, %u, %u} 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z); |
| 1643 | } |
| 1644 | static void SC_debugUI4(const char *s, uint4 i) { |
| 1645 | 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); |
| 1646 | } |
| 1647 | static void SC_debugLL64(const char *s, long long ll) { |
| 1648 | ALOGD("%s %lld 0x%llx", s, ll, ll); |
| 1649 | } |
| 1650 | static void SC_debugL2(const char *s, long2 ll) { |
| 1651 | ALOGD("%s {%lld, %lld} 0x%llx 0x%llx", s, ll.x, ll.y, ll.x, ll.y); |
| 1652 | } |
| 1653 | static void SC_debugL3(const char *s, long3 ll) { |
| 1654 | ALOGD("%s {%lld, %lld, %lld} 0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.x, ll.y, ll.z); |
| 1655 | } |
| 1656 | static void SC_debugL4(const char *s, long4 ll) { |
| 1657 | 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); |
| 1658 | } |
| 1659 | static void SC_debugULL64(const char *s, unsigned long long ll) { |
| 1660 | ALOGD("%s %llu 0x%llx", s, ll, ll); |
| 1661 | } |
| 1662 | static void SC_debugUL2(const char *s, ulong2 ll) { |
| 1663 | ALOGD("%s {%llu, %llu} 0x%llx 0x%llx", s, ll.x, ll.y, ll.x, ll.y); |
| 1664 | } |
| 1665 | static void SC_debugUL3(const char *s, ulong3 ll) { |
| 1666 | ALOGD("%s {%llu, %llu, %llu} 0x%llx 0x%llx 0x%llx", s, ll.x, ll.y, ll.z, ll.x, ll.y, ll.z); |
| 1667 | } |
| 1668 | static void SC_debugUL4(const char *s, ulong4 ll) { |
| 1669 | 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); |
| 1670 | } |
| 1671 | static void SC_debugP(const char *s, const void *p) { |
| 1672 | ALOGD("%s %p", s, p); |
| 1673 | } |
| 1674 | |
| 1675 | // TODO: allocation ops, messaging, time |
| 1676 | |
| 1677 | void rsDebug(const char *s, float f) { |
| 1678 | SC_debugF(s, f); |
| 1679 | } |
| 1680 | |
| 1681 | void rsDebug(const char *s, float f1, float f2) { |
| 1682 | SC_debugFv2(s, f1, f2); |
| 1683 | } |
| 1684 | |
| 1685 | void rsDebug(const char *s, float f1, float f2, float f3) { |
| 1686 | SC_debugFv3(s, f1, f2, f3); |
| 1687 | } |
| 1688 | |
| 1689 | void rsDebug(const char *s, float f1, float f2, float f3, float f4) { |
| 1690 | SC_debugFv4(s, f1, f2, f3, f4); |
| 1691 | } |
| 1692 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1693 | void rsDebug(const char *s, const float2 *f) { |
| 1694 | SC_debugF2(s, *f); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1695 | } |
| 1696 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1697 | void rsDebug(const char *s, const float3 *f) { |
| 1698 | SC_debugF3(s, *f); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1699 | } |
| 1700 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1701 | void rsDebug(const char *s, const float4 *f) { |
| 1702 | SC_debugF4(s, *f); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1703 | } |
| 1704 | |
| 1705 | void rsDebug(const char *s, double d) { |
| 1706 | SC_debugD(s, d); |
| 1707 | } |
| 1708 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1709 | void rsDebug(const char *s, const rs_matrix4x4 *m) { |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1710 | SC_debugFM4v4(s, (float *) m); |
| 1711 | } |
| 1712 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1713 | void rsDebug(const char *s, const rs_matrix3x3 *m) { |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1714 | SC_debugFM3v3(s, (float *) m); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1715 | } |
| 1716 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1717 | void rsDebug(const char *s, const rs_matrix2x2 *m) { |
Tim Murray | d6f1f46 | 2013-03-25 16:36:59 -0700 | [diff] [blame] | 1718 | SC_debugFM2v2(s, (float *) m); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1719 | } |
| 1720 | |
| 1721 | void rsDebug(const char *s, char c) { |
| 1722 | SC_debugI8(s, c); |
| 1723 | } |
| 1724 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1725 | void rsDebug(const char *s, const char2 *c) { |
| 1726 | SC_debugC2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1727 | } |
| 1728 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1729 | void rsDebug(const char *s, const char3 *c) { |
| 1730 | SC_debugC3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1731 | } |
| 1732 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1733 | void rsDebug(const char *s, const char4 *c) { |
| 1734 | SC_debugC4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1735 | } |
| 1736 | |
| 1737 | void rsDebug(const char *s, unsigned char c) { |
| 1738 | SC_debugU8(s, c); |
| 1739 | } |
| 1740 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1741 | void rsDebug(const char *s, const uchar2 *c) { |
| 1742 | SC_debugUC2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1743 | } |
| 1744 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1745 | void rsDebug(const char *s, const uchar3 *c) { |
| 1746 | SC_debugUC3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1747 | } |
| 1748 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1749 | void rsDebug(const char *s, const uchar4 *c) { |
| 1750 | SC_debugUC4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1751 | } |
| 1752 | |
| 1753 | void rsDebug(const char *s, short c) { |
| 1754 | SC_debugI16(s, c); |
| 1755 | } |
| 1756 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1757 | void rsDebug(const char *s, const short2 *c) { |
| 1758 | SC_debugS2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1759 | } |
| 1760 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1761 | void rsDebug(const char *s, const short3 *c) { |
| 1762 | SC_debugS3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1763 | } |
| 1764 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1765 | void rsDebug(const char *s, const short4 *c) { |
| 1766 | SC_debugS4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1767 | } |
| 1768 | |
| 1769 | void rsDebug(const char *s, unsigned short c) { |
| 1770 | SC_debugU16(s, c); |
| 1771 | } |
| 1772 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1773 | void rsDebug(const char *s, const ushort2 *c) { |
| 1774 | SC_debugUS2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1775 | } |
| 1776 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1777 | void rsDebug(const char *s, const ushort3 *c) { |
| 1778 | SC_debugUS3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1779 | } |
| 1780 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1781 | void rsDebug(const char *s, const ushort4 *c) { |
| 1782 | SC_debugUS4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1783 | } |
| 1784 | |
| 1785 | void rsDebug(const char *s, int c) { |
| 1786 | SC_debugI32(s, c); |
| 1787 | } |
| 1788 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1789 | void rsDebug(const char *s, const int2 *c) { |
| 1790 | SC_debugI2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1791 | } |
| 1792 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1793 | void rsDebug(const char *s, const int3 *c) { |
| 1794 | SC_debugI3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1795 | } |
| 1796 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1797 | void rsDebug(const char *s, const int4 *c) { |
| 1798 | SC_debugI4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1799 | } |
| 1800 | |
| 1801 | void rsDebug(const char *s, unsigned int c) { |
| 1802 | SC_debugU32(s, c); |
| 1803 | } |
| 1804 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1805 | void rsDebug(const char *s, const uint2 *c) { |
| 1806 | SC_debugUI2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1807 | } |
| 1808 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1809 | void rsDebug(const char *s, const uint3 *c) { |
| 1810 | SC_debugUI3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1811 | } |
| 1812 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1813 | void rsDebug(const char *s, const uint4 *c) { |
| 1814 | SC_debugUI4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1815 | } |
| 1816 | |
| 1817 | void rsDebug(const char *s, long c) { |
| 1818 | SC_debugLL64(s, c); |
| 1819 | } |
| 1820 | |
| 1821 | void rsDebug(const char *s, long long c) { |
| 1822 | SC_debugLL64(s, c); |
| 1823 | } |
| 1824 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1825 | void rsDebug(const char *s, const long2 *c) { |
| 1826 | SC_debugL2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1827 | } |
| 1828 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1829 | void rsDebug(const char *s, const long3 *c) { |
| 1830 | SC_debugL3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1831 | } |
| 1832 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1833 | void rsDebug(const char *s, const long4 *c) { |
| 1834 | SC_debugL4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1835 | } |
| 1836 | |
| 1837 | void rsDebug(const char *s, unsigned long c) { |
| 1838 | SC_debugULL64(s, c); |
| 1839 | } |
| 1840 | |
| 1841 | void rsDebug(const char *s, unsigned long long c) { |
| 1842 | SC_debugULL64(s, c); |
| 1843 | } |
| 1844 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1845 | void rsDebug(const char *s, const ulong2 *c) { |
| 1846 | SC_debugUL2(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1847 | } |
| 1848 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1849 | void rsDebug(const char *s, const ulong3 *c) { |
| 1850 | SC_debugUL3(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1851 | } |
| 1852 | |
Stephen Hines | b0934b6 | 2013-07-03 17:27:38 -0700 | [diff] [blame] | 1853 | void rsDebug(const char *s, const ulong4 *c) { |
| 1854 | SC_debugUL4(s, *c); |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1855 | } |
| 1856 | |
Stephen Hines | a5d9bef | 2013-12-05 17:57:49 -0800 | [diff] [blame] | 1857 | // FIXME: We need to export these function signatures for the compatibility |
| 1858 | // library. The C++ name mangling that LLVM uses for ext_vector_type requires |
| 1859 | // different versions for "long" vs. "long long". Note that the called |
| 1860 | // functions are still using the appropriate 64-bit sizes. |
| 1861 | typedef long l2 __attribute__((ext_vector_type(2))); |
| 1862 | typedef long l3 __attribute__((ext_vector_type(3))); |
| 1863 | typedef long l4 __attribute__((ext_vector_type(4))); |
| 1864 | typedef unsigned long ul2 __attribute__((ext_vector_type(2))); |
| 1865 | typedef unsigned long ul3 __attribute__((ext_vector_type(3))); |
| 1866 | typedef unsigned long ul4 __attribute__((ext_vector_type(4))); |
| 1867 | |
| 1868 | void rsDebug(const char *s, const l2 *c) { |
| 1869 | SC_debugL2(s, *(const long2 *)c); |
| 1870 | } |
| 1871 | |
| 1872 | void rsDebug(const char *s, const l3 *c) { |
| 1873 | SC_debugL3(s, *(const long3 *)c); |
| 1874 | } |
| 1875 | |
| 1876 | void rsDebug(const char *s, const l4 *c) { |
| 1877 | SC_debugL4(s, *(const long4 *)c); |
| 1878 | } |
| 1879 | |
| 1880 | void rsDebug(const char *s, const ul2 *c) { |
| 1881 | SC_debugUL2(s, *(const ulong2 *)c); |
| 1882 | } |
| 1883 | |
| 1884 | void rsDebug(const char *s, const ul3 *c) { |
| 1885 | SC_debugUL3(s, *(const ulong3 *)c); |
| 1886 | } |
| 1887 | |
| 1888 | void rsDebug(const char *s, const ul4 *c) { |
| 1889 | SC_debugUL4(s, *(const ulong4 *)c); |
| 1890 | } |
| 1891 | |
Tim Murray | 0b575de | 2013-03-15 15:56:43 -0700 | [diff] [blame] | 1892 | void rsDebug(const char *s, const void *p) { |
| 1893 | SC_debugP(s, p); |
| 1894 | } |
| 1895 | #endif // RS_COMPATIBILITY_LIB |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1896 | |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1897 | extern const RsdCpuReference::CpuSymbol * rsdLookupRuntimeStub(Context * pContext, char const* name) { |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1898 | ScriptC *s = (ScriptC *)pContext; |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1899 | const RsdCpuReference::CpuSymbol *syms = gSyms; |
| 1900 | const RsdCpuReference::CpuSymbol *sym = NULL; |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1901 | |
| 1902 | if (!sym) { |
Jason Sams | 709a097 | 2012-11-15 18:18:04 -0800 | [diff] [blame] | 1903 | while (syms->fnPtr) { |
| 1904 | if (!strcmp(syms->name, name)) { |
| 1905 | return syms; |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1906 | } |
| 1907 | syms++; |
| 1908 | } |
| 1909 | } |
| 1910 | |
Jason Sams | 87fe59a | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 1911 | return NULL; |
| 1912 | } |