blob: 0fa30d12ac2ade8c4f9730ac08c895482bb6a51b [file] [log] [blame]
/*
* Copyright (C) 2011-2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "rsContext.h"
#include "rsScriptC.h"
#include "rsMatrix4x4.h"
#include "rsMatrix3x3.h"
#include "rsMatrix2x2.h"
#include "rsRuntime.h"
#include "rsdCore.h"
#include "rsdBcc.h"
#include "rsdAllocation.h"
#include "rsdShaderCache.h"
#include "rsdVertexArray.h"
#include <time.h>
using namespace android;
using namespace android::renderscript;
typedef float float2 __attribute__((ext_vector_type(2)));
typedef float float3 __attribute__((ext_vector_type(3)));
typedef float float4 __attribute__((ext_vector_type(4)));
typedef double double2 __attribute__((ext_vector_type(2)));
typedef double double3 __attribute__((ext_vector_type(3)));
typedef double double4 __attribute__((ext_vector_type(4)));
typedef char char2 __attribute__((ext_vector_type(2)));
typedef char char3 __attribute__((ext_vector_type(3)));
typedef char char4 __attribute__((ext_vector_type(4)));
typedef unsigned char uchar2 __attribute__((ext_vector_type(2)));
typedef unsigned char uchar3 __attribute__((ext_vector_type(3)));
typedef unsigned char uchar4 __attribute__((ext_vector_type(4)));
typedef int16_t short2 __attribute__((ext_vector_type(2)));
typedef int16_t short3 __attribute__((ext_vector_type(3)));
typedef int16_t short4 __attribute__((ext_vector_type(4)));
typedef uint16_t ushort2 __attribute__((ext_vector_type(2)));
typedef uint16_t ushort3 __attribute__((ext_vector_type(3)));
typedef uint16_t ushort4 __attribute__((ext_vector_type(4)));
typedef int32_t int2 __attribute__((ext_vector_type(2)));
typedef int32_t int3 __attribute__((ext_vector_type(3)));
typedef int32_t int4 __attribute__((ext_vector_type(4)));
typedef uint32_t uint2 __attribute__((ext_vector_type(2)));
typedef uint32_t uint3 __attribute__((ext_vector_type(3)));
typedef uint32_t uint4 __attribute__((ext_vector_type(4)));
typedef int64_t long2 __attribute__((ext_vector_type(2)));
typedef int64_t long3 __attribute__((ext_vector_type(3)));
typedef int64_t long4 __attribute__((ext_vector_type(4)));
typedef uint64_t ulong2 __attribute__((ext_vector_type(2)));
typedef uint64_t ulong3 __attribute__((ext_vector_type(3)));
typedef uint64_t ulong4 __attribute__((ext_vector_type(4)));
typedef uint8_t uchar;
typedef uint16_t ushort;
typedef uint32_t uint;
#ifndef RS_SERVER
typedef uint64_t ulong;
#endif
#ifndef __LP64__
#define OPAQUETYPE(t) \
typedef struct { const int* const p; } __attribute__((packed, aligned(4))) t;
#else
#define OPAQUETYPE(t) \
typedef struct { const void* p; const void* r; const void* v1; const void* v2; } t;
#endif
OPAQUETYPE(rs_element)
OPAQUETYPE(rs_type)
OPAQUETYPE(rs_allocation)
OPAQUETYPE(rs_sampler)
OPAQUETYPE(rs_script)
OPAQUETYPE(rs_script_call)
OPAQUETYPE(rs_program_fragment);
OPAQUETYPE(rs_program_store);
OPAQUETYPE(rs_program_vertex);
OPAQUETYPE(rs_program_raster);
OPAQUETYPE(rs_mesh);
OPAQUETYPE(rs_font);
#undef OPAQUETYPE
typedef enum {
// Empty to avoid conflicting definitions with RsAllocationCubemapFace
} rs_allocation_cubemap_face;
typedef struct {
int tm_sec; ///< seconds
int tm_min; ///< minutes
int tm_hour; ///< hours
int tm_mday; ///< day of the month
int tm_mon; ///< month
int tm_year; ///< year
int tm_wday; ///< day of the week
int tm_yday; ///< day of the year
int tm_isdst; ///< daylight savings time
} rs_tm;
#ifndef __LP64__
typedef android::renderscript::rs_script RS_TY_SCRIPT;
typedef android::renderscript::rs_allocation RS_TY_ALLOC;
static inline Script* rsGetObjPtr(RS_TY_SCRIPT s) {
return const_cast<Script*>(s.p);
}
static inline Allocation* rsGetObjPtr(RS_TY_ALLOC a) {
return const_cast<Allocation*>(a.p);
}
static inline RS_TY_SCRIPT rsTyCast(::rs_script s) {
RS_TY_SCRIPT cast;
cast.p = (const Script*)s.p;
return cast;
}
static inline RS_TY_ALLOC rsTyCast(::rs_allocation a) {
RS_TY_ALLOC cast;
cast.p = (const Allocation*)a.p;
return cast;
}
#define RS_CAST(a) rsTyCast(a)
#else
typedef android::renderscript::rs_script* RS_TY_SCRIPT;
typedef android::renderscript::rs_allocation* RS_TY_ALLOC;
static inline Script* rsGetObjPtr(RS_TY_SCRIPT s) {
return const_cast<Script*>(s->p);
}
static inline Allocation* rsGetObjPtr(RS_TY_ALLOC a) {
return const_cast<Allocation*>(a->p);
}
static inline RS_TY_SCRIPT rsTyCast(::rs_script *s) {
return reinterpret_cast<RS_TY_SCRIPT>(s);
}
static inline RS_TY_ALLOC rsTyCast(::rs_allocation *a) {
return reinterpret_cast<RS_TY_ALLOC>(a);
}
#define RS_CAST(a) rsTyCast(&(a))
#endif
// Some RS functions are not threadsafe but can be called from an invoke
// function. Instead of summarily marking scripts that call these functions as
// not-threadable we detect calls to them in the driver and sends a fatal error
// message.
static bool failIfInKernel(Context *rsc, const char *funcName) {
RsdHal *dc = (RsdHal *)rsc->mHal.drv;
RsdCpuReference *impl = (RsdCpuReference *) dc->mCpuRef;
if (impl->getInForEach()) {
char buf[256];
sprintf(buf, "Error: Call to unsupported function %s "
"in kernel", funcName);
rsc->setError(RS_ERROR_FATAL_DRIVER, buf);
return true;
}
return false;
}
//////////////////////////////////////////////////////////////////////////////
// Allocation
//////////////////////////////////////////////////////////////////////////////
static void SC_AllocationSyncAll2(RS_TY_ALLOC a, RsAllocationUsageType source) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrAllocationSyncAll(rsc, rsGetObjPtr(a), source);
}
static void SC_AllocationSyncAll(RS_TY_ALLOC a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrAllocationSyncAll(rsc, rsGetObjPtr(a), RS_ALLOCATION_USAGE_SCRIPT);
}
#ifndef RS_COMPATIBILITY_LIB
static void SC_AllocationCopy1DRange(RS_TY_ALLOC dstAlloc,
uint32_t dstOff,
uint32_t dstMip,
uint32_t count,
RS_TY_ALLOC srcAlloc,
uint32_t srcOff, uint32_t srcMip) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationCopy1DRange"))
return;
rsrAllocationCopy1DRange(rsc, rsGetObjPtr(dstAlloc), dstOff, dstMip, count,
rsGetObjPtr(srcAlloc), srcOff, srcMip);
}
static void SC_AllocationCopy2DRange(RS_TY_ALLOC dstAlloc,
uint32_t dstXoff, uint32_t dstYoff,
uint32_t dstMip, uint32_t dstFace,
uint32_t width, uint32_t height,
RS_TY_ALLOC srcAlloc,
uint32_t srcXoff, uint32_t srcYoff,
uint32_t srcMip, uint32_t srcFace) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationCopy2DRange"))
return;
rsrAllocationCopy2DRange(rsc, rsGetObjPtr(dstAlloc),
dstXoff, dstYoff, dstMip, dstFace,
width, height, rsGetObjPtr(srcAlloc),
srcXoff, srcYoff, srcMip, srcFace);
}
static void SC_AllocationIoSend(RS_TY_ALLOC alloc) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationIoSend"))
return;
rsrAllocationIoSend(rsc, rsGetObjPtr(alloc));
}
static void SC_AllocationIoReceive(RS_TY_ALLOC alloc) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationIoReceive"))
return;
rsrAllocationIoReceive(rsc, rsGetObjPtr(alloc));
}
#else
static void SC_AllocationCopy1DRange(RS_TY_ALLOC dstAlloc,
uint32_t dstOff,
uint32_t dstMip,
uint32_t count,
RS_TY_ALLOC srcAlloc,
uint32_t srcOff, uint32_t srcMip) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationCopy1DRange"))
return;
rsrAllocationCopy1DRange(rsc, rsGetObjPtr(dstAlloc), dstOff, dstMip, count,
rsGetObjPtr(srcAlloc), srcOff, srcMip);
}
static void SC_AllocationCopy2DRange(RS_TY_ALLOC dstAlloc,
uint32_t dstXoff, uint32_t dstYoff,
uint32_t dstMip, uint32_t dstFace,
uint32_t width, uint32_t height,
RS_TY_ALLOC srcAlloc,
uint32_t srcXoff, uint32_t srcYoff,
uint32_t srcMip, uint32_t srcFace) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationCopy2DRange"))
return;
rsrAllocationCopy2DRange(rsc, rsGetObjPtr(dstAlloc),
dstXoff, dstYoff, dstMip, dstFace,
width, height,
rsGetObjPtr(srcAlloc),
srcXoff, srcYoff, srcMip, srcFace);
}
static void SC_AllocationIoSend(RS_TY_ALLOC alloc) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationIoSend"))
return;
rsrAllocationIoSend(rsc, rsGetObjPtr(alloc));
}
static void SC_AllocationIoReceive(RS_TY_ALLOC alloc) {
Context *rsc = RsdCpuReference::getTlsContext();
if (failIfInKernel(rsc, "rsAllocationIoReceive"))
return;
rsrAllocationIoReceive(rsc, rsGetObjPtr(alloc));
}
#endif
#ifndef RS_COMPATIBILITY_LIB
//////////////////////////////////////////////////////////////////////////////
// Context
//////////////////////////////////////////////////////////////////////////////
static void SC_BindTexture(ProgramFragment *pf, uint32_t slot, Allocation *a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindTexture(rsc, pf, slot, a);
}
static void SC_BindVertexConstant(ProgramVertex *pv, uint32_t slot, Allocation *a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindConstant(rsc, pv, slot, a);
}
static void SC_BindFragmentConstant(ProgramFragment *pf, uint32_t slot, Allocation *a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindConstant(rsc, pf, slot, a);
}
static void SC_BindSampler(ProgramFragment *pf, uint32_t slot, Sampler *s) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindSampler(rsc, pf, slot, s);
}
static void SC_BindProgramStore(ProgramStore *ps) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindProgramStore(rsc, ps);
}
static void SC_BindProgramFragment(ProgramFragment *pf) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindProgramFragment(rsc, pf);
}
static void SC_BindProgramVertex(ProgramVertex *pv) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindProgramVertex(rsc, pv);
}
static void SC_BindProgramRaster(ProgramRaster *pr) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindProgramRaster(rsc, pr);
}
static void SC_BindFrameBufferObjectColorTarget(Allocation *a, uint32_t slot) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindFrameBufferObjectColorTarget(rsc, a, slot);
}
static void SC_BindFrameBufferObjectDepthTarget(Allocation *a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindFrameBufferObjectDepthTarget(rsc, a);
}
static void SC_ClearFrameBufferObjectColorTarget(uint32_t slot) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrClearFrameBufferObjectColorTarget(rsc, slot);
}
static void SC_ClearFrameBufferObjectDepthTarget(Context *, Script *) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrClearFrameBufferObjectDepthTarget(rsc);
}
static void SC_ClearFrameBufferObjectTargets(Context *, Script *) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrClearFrameBufferObjectTargets(rsc);
}
//////////////////////////////////////////////////////////////////////////////
// VP
//////////////////////////////////////////////////////////////////////////////
static void SC_VpLoadProjectionMatrix(const rsc_Matrix *m) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrVpLoadProjectionMatrix(rsc, m);
}
static void SC_VpLoadModelMatrix(const rsc_Matrix *m) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrVpLoadModelMatrix(rsc, m);
}
static void SC_VpLoadTextureMatrix(const rsc_Matrix *m) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrVpLoadTextureMatrix(rsc, m);
}
static void SC_PfConstantColor(ProgramFragment *pf, float r, float g, float b, float a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrPfConstantColor(rsc, pf, r, g, b, a);
}
static void SC_VpGetProjectionMatrix(rsc_Matrix *m) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrVpGetProjectionMatrix(rsc, m);
}
//////////////////////////////////////////////////////////////////////////////
// Drawing
//////////////////////////////////////////////////////////////////////////////
static void SC_DrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
float x2, float y2, float z2, float u2, float v2,
float x3, float y3, float z3, float u3, float v3,
float x4, float y4, float z4, float u4, float v4) {
Context *rsc = RsdCpuReference::getTlsContext();
if (!rsc->setupCheck()) {
return;
}
RsdHal *dc = (RsdHal *)rsc->mHal.drv;
if (!dc->gl.shaderCache->setup(rsc)) {
return;
}
//ALOGE("Quad");
//ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1);
//ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2);
//ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3);
//ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4);
float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4};
const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4};
RsdVertexArray::Attrib attribs[2];
attribs[0].set(GL_FLOAT, 3, 12, false, (size_t)vtx, "ATTRIB_position");
attribs[1].set(GL_FLOAT, 2, 8, false, (size_t)tex, "ATTRIB_texture0");
RsdVertexArray va(attribs, 2);
va.setup(rsc);
RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4);
}
static void SC_DrawQuad(float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
SC_DrawQuadTexCoords(x1, y1, z1, 0, 1,
x2, y2, z2, 1, 1,
x3, y3, z3, 1, 0,
x4, y4, z4, 0, 0);
}
static void SC_DrawSpriteScreenspace(float x, float y, float z, float w, float h) {
Context *rsc = RsdCpuReference::getTlsContext();
ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex());
rsc->setProgramVertex(rsc->getDefaultProgramVertex());
//rsc->setupCheck();
//GLint crop[4] = {0, h, w, -h};
float sh = rsc->getHeight();
SC_DrawQuad(x, sh - y, z,
x+w, sh - y, z,
x+w, sh - (y+h), z,
x, sh - (y+h), z);
rsc->setProgramVertex((ProgramVertex *)tmp.get());
}
static void SC_DrawRect(float x1, float y1, float x2, float y2, float z) {
SC_DrawQuad(x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z);
}
static void SC_DrawMesh(Mesh *m) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrDrawMesh(rsc, m);
}
static void SC_DrawMeshPrimitive(Mesh *m, uint32_t primIndex) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrDrawMeshPrimitive(rsc, m, primIndex);
}
static void SC_DrawMeshPrimitiveRange(Mesh *m, uint32_t primIndex, uint32_t start, uint32_t len) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrDrawMeshPrimitiveRange(rsc, m, primIndex, start, len);
}
static void SC_MeshComputeBoundingBox(Mesh *m,
float *minX, float *minY, float *minZ,
float *maxX, float *maxY, float *maxZ) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrMeshComputeBoundingBox(rsc, m, minX, minY, minZ, maxX, maxY, maxZ);
}
//////////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////////
static void SC_Color(float r, float g, float b, float a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrColor(rsc, r, g, b, a);
}
static void SC_Finish() {
Context *rsc = RsdCpuReference::getTlsContext();
rsdGLFinish(rsc);
}
static void SC_ClearColor(float r, float g, float b, float a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrPrepareClear(rsc);
rsdGLClearColor(rsc, r, g, b, a);
}
static void SC_ClearDepth(float v) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrPrepareClear(rsc);
rsdGLClearDepth(rsc, v);
}
static uint32_t SC_GetWidth() {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrGetWidth(rsc);
}
static uint32_t SC_GetHeight() {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrGetHeight(rsc);
}
static void SC_DrawTextAlloc(Allocation *a, int x, int y) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrDrawTextAlloc(rsc, a, x, y);
}
static void SC_DrawText(const char *text, int x, int y) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrDrawText(rsc, text, x, y);
}
static void SC_MeasureTextAlloc(Allocation *a,
int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrMeasureTextAlloc(rsc, a, left, right, top, bottom);
}
static void SC_MeasureText(const char *text,
int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrMeasureText(rsc, text, left, right, top, bottom);
}
static void SC_BindFont(Font *f) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrBindFont(rsc, f);
}
static void SC_FontColor(float r, float g, float b, float a) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrFontColor(rsc, r, g, b, a);
}
#endif
//////////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////////
static void SC_ClearObject(rs_object_base *dst) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrClearObject(rsc, dst);
}
static void SC_SetObject(rs_object_base *dst, rs_object_base src) {
// ALOGE("SC_SetObject: dst = %p, src = %p", dst, src.p);
// ALOGE("SC_SetObject: dst[0] = %p", dst[0]);
Context *rsc = RsdCpuReference::getTlsContext();
rsrSetObject(rsc, dst, (ObjectBase*)src.p);
}
static bool SC_IsObject(rs_object_base o) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrIsObject(rsc, o);
}
#ifdef __LP64__
static void SC_SetObject_ByRef(rs_object_base *dst, rs_object_base *src) {
// ALOGE("SC_SetObject_ByRef: dst = %p, src = %p", dst, src->p);
Context *rsc = RsdCpuReference::getTlsContext();
rsrSetObject(rsc, dst, (ObjectBase*)src->p);
}
static bool SC_IsObject_ByRef(rs_object_base *o) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrIsObject(rsc, *o);
}
#endif
#ifndef RS_COMPATIBILITY_LIB
#ifndef __LP64__
// i386 has different struct return passing to ARM; emulate with void*
#ifdef __i386__
static const void* SC_GetAllocation(const void *ptr) {
Context *rsc = RsdCpuReference::getTlsContext();
const Script *sc = RsdCpuReference::getTlsScript();
Allocation* alloc = rsdScriptGetAllocationForPointer(rsc, sc, ptr);
android::renderscript::rs_allocation obj = {0};
alloc->callUpdateCacheObject(rsc, &obj);
return (void*)obj.p;
}
#else
// ARMv7/MIPS
static const android::renderscript::rs_allocation SC_GetAllocation(const void *ptr) {
Context *rsc = RsdCpuReference::getTlsContext();
const Script *sc = RsdCpuReference::getTlsScript();
Allocation* alloc = rsdScriptGetAllocationForPointer(rsc, sc, ptr);
android::renderscript::rs_allocation obj = {0};
alloc->callUpdateCacheObject(rsc, &obj);
return obj;
}
#endif
#else
// AArch64/x86_64/MIPS64
static const android::renderscript::rs_allocation SC_GetAllocation(const void *ptr) {
Context *rsc = RsdCpuReference::getTlsContext();
const Script *sc = RsdCpuReference::getTlsScript();
Allocation* alloc = rsdScriptGetAllocationForPointer(rsc, sc, ptr);
android::renderscript::rs_allocation obj = {0, 0, 0, 0};
alloc->callUpdateCacheObject(rsc, &obj);
return obj;
}
#endif
#endif
static void SC_ForEach_SAA(RS_TY_SCRIPT target, RS_TY_ALLOC in, RS_TY_ALLOC out) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrForEach(rsc, rsGetObjPtr(target), rsGetObjPtr(in), rsGetObjPtr(out), nullptr, 0, nullptr);
}
static void SC_ForEach_SAAU(RS_TY_SCRIPT target, RS_TY_ALLOC in,
RS_TY_ALLOC out, const void *usr) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrForEach(rsc, rsGetObjPtr(target), rsGetObjPtr(in), rsGetObjPtr(out), usr, 0, nullptr);
}
static void SC_ForEach_SAAUS(RS_TY_SCRIPT target, RS_TY_ALLOC in,
RS_TY_ALLOC out, const void *usr, const RsScriptCall *call) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrForEach(rsc, rsGetObjPtr(target), rsGetObjPtr(in), rsGetObjPtr(out), usr, 0, call);
}
// These functions are only supported in 32-bit.
#ifndef __LP64__
static void SC_ForEach_SAAUL(RS_TY_SCRIPT target, RS_TY_ALLOC in,
RS_TY_ALLOC out, const void *usr, uint32_t usrLen) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrForEach(rsc, rsGetObjPtr(target), rsGetObjPtr(in), rsGetObjPtr(out), usr, usrLen, nullptr);
}
static void SC_ForEach_SAAULS(RS_TY_SCRIPT target, RS_TY_ALLOC in, RS_TY_ALLOC out,
const void *usr, uint32_t usrLen, const RsScriptCall *call) {
Context *rsc = RsdCpuReference::getTlsContext();
rsrForEach(rsc, rsGetObjPtr(target), rsGetObjPtr(in), rsGetObjPtr(out), usr, usrLen, call);
}
#endif
//////////////////////////////////////////////////////////////////////////////
// Time routines
//////////////////////////////////////////////////////////////////////////////
static float SC_GetDt() {
Context *rsc = RsdCpuReference::getTlsContext();
const Script *sc = RsdCpuReference::getTlsScript();
return rsrGetDt(rsc, sc);
}
// #if !defined(RS_COMPATIBILITY_LIB) && defined(__LP64__)
#ifdef __LP64__
time_t SC_Time(time_t *timer) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrTime(rsc, timer);
}
#else
static int SC_Time(int *timer) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrTime(rsc, (long*)timer);
}
#endif
tm* SC_LocalTime(tm *local, time_t *timer) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrLocalTime(rsc, local, timer);
}
int64_t SC_UptimeMillis() {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrUptimeMillis(rsc);
}
int64_t SC_UptimeNanos() {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrUptimeNanos(rsc);
}
//////////////////////////////////////////////////////////////////////////////
// Message routines
//////////////////////////////////////////////////////////////////////////////
static uint32_t SC_ToClient2(int cmdID, const void *data, uint32_t len) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrToClient(rsc, cmdID, data, len);
}
static uint32_t SC_ToClient(int cmdID) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrToClient(rsc, cmdID, (const void *)nullptr, 0);
}
static uint32_t SC_ToClientBlocking2(int cmdID, const void *data, uint32_t len) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrToClientBlocking(rsc, cmdID, data, len);
}
static uint32_t SC_ToClientBlocking(int cmdID) {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrToClientBlocking(rsc, cmdID, (const void *)nullptr, 0);
}
static void * ElementAt1D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x) {
Context *rsc = RsdCpuReference::getTlsContext();
const Type *t = a->getType();
const Element *e = t->getElement();
char buf[256];
if (x >= t->getLODDimX(0)) {
sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (vecSize > 0) {
if (vecSize != e->getVectorSize()) {
sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (dt != e->getType()) {
sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
}
uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = e->getSizeBytes();
return &p[(eSize * x)];
}
static void * ElementAt2D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y) {
Context *rsc = RsdCpuReference::getTlsContext();
const Type *t = a->getType();
const Element *e = t->getElement();
char buf[256];
if (x >= t->getLODDimX(0)) {
sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (y >= t->getLODDimY(0)) {
sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (vecSize > 0) {
if (vecSize != e->getVectorSize()) {
sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (dt != e->getType()) {
sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
}
uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = e->getSizeBytes();
const uint32_t stride = a->mHal.drvState.lod[0].stride;
return &p[(eSize * x) + (y * stride)];
}
static void * ElementAt3D(Allocation *a, RsDataType dt, uint32_t vecSize, uint32_t x, uint32_t y, uint32_t z) {
Context *rsc = RsdCpuReference::getTlsContext();
const Type *t = a->getType();
const Element *e = t->getElement();
char buf[256];
if (x >= t->getLODDimX(0)) {
sprintf(buf, "Out range ElementAt X %i of %i", x, t->getLODDimX(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (y >= t->getLODDimY(0)) {
sprintf(buf, "Out range ElementAt Y %i of %i", y, t->getLODDimY(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (z >= t->getLODDimZ(0)) {
sprintf(buf, "Out range ElementAt Z %i of %i", z, t->getLODDimZ(0));
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (vecSize > 0) {
if (vecSize != e->getVectorSize()) {
sprintf(buf, "Vector size mismatch for ElementAt %i of %i", vecSize, e->getVectorSize());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
if (dt != e->getType()) {
sprintf(buf, "Data type mismatch for ElementAt %i of %i", dt, e->getType());
rsc->setError(RS_ERROR_FATAL_DEBUG, buf);
return nullptr;
}
}
uint8_t *p = (uint8_t *)a->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = e->getSizeBytes();
const uint32_t stride = a->mHal.drvState.lod[0].stride;
return &p[(eSize * x) + (y * stride)];
}
static const void * SC_GetElementAt1D(RS_TY_ALLOC a, uint32_t x) {
return ElementAt1D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x);
}
static const void * SC_GetElementAt2D(RS_TY_ALLOC a, uint32_t x, uint32_t y) {
return ElementAt2D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x, y);
}
static const void * SC_GetElementAt3D(RS_TY_ALLOC a, uint32_t x, uint32_t y, uint32_t z) {
return ElementAt3D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x, y, z);
}
static void SC_SetElementAt1D(RS_TY_ALLOC a, const void *ptr, uint32_t x) {
const Type *t = rsGetObjPtr(a)->getType();
const Element *e = t->getElement();
void *tmp = ElementAt1D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x);
if (tmp != nullptr) {
memcpy(tmp, ptr, e->getSizeBytes());
}
}
static void SC_SetElementAt2D(RS_TY_ALLOC a, const void *ptr, uint32_t x, uint32_t y) {
const Type *t = rsGetObjPtr(a)->getType();
const Element *e = t->getElement();
void *tmp = ElementAt2D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x, y);
if (tmp != nullptr) {
memcpy(tmp, ptr, e->getSizeBytes());
}
}
static void SC_SetElementAt3D(RS_TY_ALLOC a, const void *ptr, uint32_t x, uint32_t y, uint32_t z) {
const Type *t = rsGetObjPtr(a)->getType();
const Element *e = t->getElement();
void *tmp = ElementAt3D(rsGetObjPtr(a), RS_TYPE_UNSIGNED_8, 0, x, y, z);
if (tmp != nullptr) {
memcpy(tmp, ptr, e->getSizeBytes());
}
}
const void *rsGetElementAt(::rs_allocation a, uint32_t x) {
return SC_GetElementAt1D(RS_CAST(a), x);
}
const void *rsGetElementAt(::rs_allocation a, uint32_t x, uint32_t y) {
return SC_GetElementAt2D(RS_CAST(a), x, y);
}
const void *rsGetElementAt(::rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
return SC_GetElementAt3D(RS_CAST(a), x, y, z);
}
void rsSetElementAt(::rs_allocation a, const void *ptr, uint32_t x) {
SC_SetElementAt1D(RS_CAST(a), ptr, x);
}
void rsSetElementAt(::rs_allocation a, const void *ptr, uint32_t x, uint32_t y) {
SC_SetElementAt2D(RS_CAST(a), ptr, x, y);
}
void rsSetElementAt(::rs_allocation a, const void *ptr, uint32_t x, uint32_t y, uint32_t z) {
SC_SetElementAt3D(RS_CAST(a), ptr, x, y, z);
}
#define ELEMENT_AT(T, DT, VS) \
static void SC_SetElementAt1_##T(RS_TY_ALLOC a, const T *val, uint32_t x) { \
void *r = ElementAt1D(rsGetObjPtr(a), DT, VS, x); \
if (r != nullptr) ((T *)r)[0] = *val; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
static void SC_SetElementAt2_##T(RS_TY_ALLOC a, const T * val, uint32_t x, uint32_t y) { \
void *r = ElementAt2D(rsGetObjPtr(a), DT, VS, x, y); \
if (r != nullptr) ((T *)r)[0] = *val; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
static void SC_SetElementAt3_##T(RS_TY_ALLOC a, const T * val, uint32_t x, uint32_t y, uint32_t z) { \
void *r = ElementAt3D(rsGetObjPtr(a), DT, VS, x, y, z); \
if (r != nullptr) ((T *)r)[0] = *val; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
static void SC_GetElementAt1_##T(RS_TY_ALLOC a, T *val, uint32_t x) { \
void *r = ElementAt1D(rsGetObjPtr(a), DT, VS, x); \
if (r != nullptr) *val = ((T *)r)[0]; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
static void SC_GetElementAt2_##T(RS_TY_ALLOC a, T *val, uint32_t x, uint32_t y) { \
void *r = ElementAt2D(rsGetObjPtr(a), DT, VS, x, y); \
if (r != nullptr) *val = ((T *)r)[0]; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
static void SC_GetElementAt3_##T(RS_TY_ALLOC a, T *val, uint32_t x, uint32_t y, uint32_t z) { \
void *r = ElementAt3D(rsGetObjPtr(a), DT, VS, x, y, z); \
if (r != nullptr) *val = ((T *)r)[0]; \
else ALOGE("Error from %s", __PRETTY_FUNCTION__); \
} \
void rsSetElementAt_##T(::rs_allocation a, const T *val, uint32_t x) { \
SC_SetElementAt1_##T(RS_CAST(a), val, x); \
} \
void rsSetElementAt_##T(::rs_allocation a, const T *val, uint32_t x, uint32_t y) { \
SC_SetElementAt2_##T(RS_CAST(a), val, x, y); \
} \
void rsSetElementAt_##T(::rs_allocation a, const T *val, uint32_t x, uint32_t y, uint32_t z) { \
SC_SetElementAt3_##T(RS_CAST(a), val, x, y, z); \
} \
void rsGetElementAt_##T(::rs_allocation a, T *val, uint32_t x) { \
SC_GetElementAt1_##T(RS_CAST(a), val, x); \
} \
void rsGetElementAt_##T(::rs_allocation a, T *val, uint32_t x, uint32_t y) { \
SC_GetElementAt2_##T(RS_CAST(a), val, x, y); \
} \
void rsGetElementAt_##T(::rs_allocation a, T *val, uint32_t x, uint32_t y, uint32_t z) { \
SC_GetElementAt3_##T(RS_CAST(a), val, x, y, z); \
} \
ELEMENT_AT(char, RS_TYPE_SIGNED_8, 1)
ELEMENT_AT(char2, RS_TYPE_SIGNED_8, 2)
ELEMENT_AT(char3, RS_TYPE_SIGNED_8, 3)
ELEMENT_AT(char4, RS_TYPE_SIGNED_8, 4)
ELEMENT_AT(uchar, RS_TYPE_UNSIGNED_8, 1)
ELEMENT_AT(uchar2, RS_TYPE_UNSIGNED_8, 2)
ELEMENT_AT(uchar3, RS_TYPE_UNSIGNED_8, 3)
ELEMENT_AT(uchar4, RS_TYPE_UNSIGNED_8, 4)
ELEMENT_AT(short, RS_TYPE_SIGNED_16, 1)
ELEMENT_AT(short2, RS_TYPE_SIGNED_16, 2)
ELEMENT_AT(short3, RS_TYPE_SIGNED_16, 3)
ELEMENT_AT(short4, RS_TYPE_SIGNED_16, 4)
ELEMENT_AT(ushort, RS_TYPE_UNSIGNED_16, 1)
ELEMENT_AT(ushort2, RS_TYPE_UNSIGNED_16, 2)
ELEMENT_AT(ushort3, RS_TYPE_UNSIGNED_16, 3)
ELEMENT_AT(ushort4, RS_TYPE_UNSIGNED_16, 4)
ELEMENT_AT(int, RS_TYPE_SIGNED_32, 1)
ELEMENT_AT(int2, RS_TYPE_SIGNED_32, 2)
ELEMENT_AT(int3, RS_TYPE_SIGNED_32, 3)
ELEMENT_AT(int4, RS_TYPE_SIGNED_32, 4)
ELEMENT_AT(uint, RS_TYPE_UNSIGNED_32, 1)
ELEMENT_AT(uint2, RS_TYPE_UNSIGNED_32, 2)
ELEMENT_AT(uint3, RS_TYPE_UNSIGNED_32, 3)
ELEMENT_AT(uint4, RS_TYPE_UNSIGNED_32, 4)
ELEMENT_AT(long, RS_TYPE_SIGNED_64, 1)
ELEMENT_AT(long2, RS_TYPE_SIGNED_64, 2)
ELEMENT_AT(long3, RS_TYPE_SIGNED_64, 3)
ELEMENT_AT(long4, RS_TYPE_SIGNED_64, 4)
ELEMENT_AT(ulong, RS_TYPE_UNSIGNED_64, 1)
ELEMENT_AT(ulong2, RS_TYPE_UNSIGNED_64, 2)
ELEMENT_AT(ulong3, RS_TYPE_UNSIGNED_64, 3)
ELEMENT_AT(ulong4, RS_TYPE_UNSIGNED_64, 4)
ELEMENT_AT(float, RS_TYPE_FLOAT_32, 1)
ELEMENT_AT(float2, RS_TYPE_FLOAT_32, 2)
ELEMENT_AT(float3, RS_TYPE_FLOAT_32, 3)
ELEMENT_AT(float4, RS_TYPE_FLOAT_32, 4)
ELEMENT_AT(double, RS_TYPE_FLOAT_64, 1)
ELEMENT_AT(double2, RS_TYPE_FLOAT_64, 2)
ELEMENT_AT(double3, RS_TYPE_FLOAT_64, 3)
ELEMENT_AT(double4, RS_TYPE_FLOAT_64, 4)
#undef ELEMENT_AT
#ifndef __LP64__
/*
* We miss some symbols for rs{Get,Set}Element_long,ulong variants because 64
* bit integer values are 'long' in RS-land but might be 'long long' in the
* driver. Define native_long* and native_ulong* types to be vectors of
* 'long' as seen by the driver and define overloaded versions of
* rsSetElementAt_* and rsGetElementAt_*. This should get us the correct
* mangled names in the driver.
*/
typedef long native_long2 __attribute__((ext_vector_type(2)));
typedef long native_long3 __attribute__((ext_vector_type(3)));
typedef long native_long4 __attribute__((ext_vector_type(4)));
typedef unsigned long native_ulong2 __attribute__((ext_vector_type(2)));
typedef unsigned long native_ulong3 __attribute__((ext_vector_type(3)));
typedef unsigned long native_ulong4 __attribute__((ext_vector_type(4)));
#define ELEMENT_AT_OVERLOADS(T, U) \
void rsSetElementAt_##T(::rs_allocation a, const U *val, uint32_t x) { \
SC_SetElementAt1_##T(RS_CAST(a), (T *) val, x); \
} \
void rsSetElementAt_##T(::rs_allocation a, const U *val, uint32_t x, uint32_t y) { \
SC_SetElementAt2_##T(RS_CAST(a), (T *) val, x, y); \
} \
void rsSetElementAt_##T(::rs_allocation a, const U *val, uint32_t x, uint32_t y, uint32_t z) { \
SC_SetElementAt3_##T(RS_CAST(a), (T *) val, x, y, z); \
} \
void rsGetElementAt_##T(::rs_allocation a, U *val, uint32_t x) { \
SC_GetElementAt1_##T(RS_CAST(a), (T *) val, x); \
} \
void rsGetElementAt_##T(::rs_allocation a, U *val, uint32_t x, uint32_t y) { \
SC_GetElementAt2_##T(RS_CAST(a), (T *) val, x, y); \
} \
void rsGetElementAt_##T(::rs_allocation a, U *val, uint32_t x, uint32_t y, uint32_t z) { \
SC_GetElementAt3_##T(RS_CAST(a), (T *) val, x, y, z); \
} \
ELEMENT_AT_OVERLOADS(long2, native_long2)
ELEMENT_AT_OVERLOADS(long3, native_long3)
ELEMENT_AT_OVERLOADS(long4, native_long4)
ELEMENT_AT_OVERLOADS(ulong, unsigned long)
ELEMENT_AT_OVERLOADS(ulong2, native_ulong2)
ELEMENT_AT_OVERLOADS(ulong3, native_ulong3)
ELEMENT_AT_OVERLOADS(ulong4, native_ulong4)
// We also need variants of rs{Get,Set}ElementAt_long that take 'long long *' as
// we might have this overloaded variant in old APKs.
ELEMENT_AT_OVERLOADS(long, long long)
#undef ELEMENT_AT_OVERLOADS
#endif
//////////////////////////////////////////////////////////////////////////////
// Stub implementation
//////////////////////////////////////////////////////////////////////////////
// llvm name mangling ref
// <builtin-type> ::= v # void
// ::= b # bool
// ::= c # char
// ::= a # signed char
// ::= h # unsigned char
// ::= s # short
// ::= t # unsigned short
// ::= i # int
// ::= j # unsigned int
// ::= l # long
// ::= m # unsigned long
// ::= x # long long, __int64
// ::= y # unsigned long long, __int64
// ::= f # float
// ::= d # double
static RsdCpuReference::CpuSymbol gSyms[] = {
// Debug runtime
{ "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_GetElementAt1D, true },
{ "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_GetElementAt2D, true },
{ "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_GetElementAt3D, true },
{ "_Z14rsSetElementAt13rs_allocationPKvj", (void *)&SC_SetElementAt1D, true },
{ "_Z14rsSetElementAt13rs_allocationPKvjj", (void *)&SC_SetElementAt2D, true },
{ "_Z14rsSetElementAt13rs_allocationPKvjjj", (void *)&SC_SetElementAt3D, true },
{ "_Z20rsGetElementAt_uchar13rs_allocationPhj", (void *)&SC_GetElementAt1_uchar, true },
{ "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hj", (void *)&SC_GetElementAt1_uchar2, true },
{ "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hj", (void *)&SC_GetElementAt1_uchar3, true },
{ "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hj", (void *)&SC_GetElementAt1_uchar4, true },
{ "_Z20rsGetElementAt_uchar13rs_allocationPhjj", (void *)&SC_GetElementAt2_uchar, true },
{ "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjj", (void *)&SC_GetElementAt2_uchar2, true },
{ "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjj", (void *)&SC_GetElementAt2_uchar3, true },
{ "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjj", (void *)&SC_GetElementAt2_uchar4, true },
{ "_Z20rsGetElementAt_uchar13rs_allocationPhjjj", (void *)&SC_GetElementAt3_uchar, true },
{ "_Z21rsGetElementAt_uchar213rs_allocationPDv2_hjjj", (void *)&SC_GetElementAt3_uchar2, true },
{ "_Z21rsGetElementAt_uchar313rs_allocationPDv3_hjjj", (void *)&SC_GetElementAt3_uchar3, true },
{ "_Z21rsGetElementAt_uchar413rs_allocationPDv4_hjjj", (void *)&SC_GetElementAt3_uchar4, true },
{ "_Z19rsGetElementAt_char13rs_allocationPcj", (void *)&SC_GetElementAt1_char, true },
{ "_Z20rsGetElementAt_char213rs_allocationPDv2_cj", (void *)&SC_GetElementAt1_char2, true },
{ "_Z20rsGetElementAt_char313rs_allocationPDv3_cj", (void *)&SC_GetElementAt1_char3, true },
{ "_Z20rsGetElementAt_char413rs_allocationPDv4_cj", (void *)&SC_GetElementAt1_char4, true },
{ "_Z19rsGetElementAt_char13rs_allocationPcjj", (void *)&SC_GetElementAt2_char, true },
{ "_Z20rsGetElementAt_char213rs_allocationPDv2_cjj", (void *)&SC_GetElementAt2_char2, true },
{ "_Z20rsGetElementAt_char313rs_allocationPDv3_cjj", (void *)&SC_GetElementAt2_char3, true },
{ "_Z20rsGetElementAt_char413rs_allocationPDv4_cjj", (void *)&SC_GetElementAt2_char4, true },
{ "_Z19rsGetElementAt_char13rs_allocationPcjjj", (void *)&SC_GetElementAt3_char, true },
{ "_Z20rsGetElementAt_char213rs_allocationPDv2_cjjj", (void *)&SC_GetElementAt3_char2, true },
{ "_Z20rsGetElementAt_char313rs_allocationPDv3_cjjj", (void *)&SC_GetElementAt3_char3, true },
{ "_Z20rsGetElementAt_char413rs_allocationPDv4_cjjj", (void *)&SC_GetElementAt3_char4, true },
{ "_Z21rsGetElementAt_ushort13rs_allocationPtj", (void *)&SC_GetElementAt1_ushort, true },
{ "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tj", (void *)&SC_GetElementAt1_ushort2, true },
{ "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tj", (void *)&SC_GetElementAt1_ushort3, true },
{ "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tj", (void *)&SC_GetElementAt1_ushort4, true },
{ "_Z21rsGetElementAt_ushort13rs_allocationPtjj", (void *)&SC_GetElementAt2_ushort, true },
{ "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjj", (void *)&SC_GetElementAt2_ushort2, true },
{ "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjj", (void *)&SC_GetElementAt2_ushort3, true },
{ "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjj", (void *)&SC_GetElementAt2_ushort4, true },
{ "_Z21rsGetElementAt_ushort13rs_allocationPtjjj", (void *)&SC_GetElementAt3_ushort, true },
{ "_Z22rsGetElementAt_ushort213rs_allocationPDv2_tjjj", (void *)&SC_GetElementAt3_ushort2, true },
{ "_Z22rsGetElementAt_ushort313rs_allocationPDv3_tjjj", (void *)&SC_GetElementAt3_ushort3, true },
{ "_Z22rsGetElementAt_ushort413rs_allocationPDv4_tjjj", (void *)&SC_GetElementAt3_ushort4, true },
{ "_Z20rsGetElementAt_short13rs_allocationPsj", (void *)&SC_GetElementAt1_short, true },
{ "_Z21rsGetElementAt_short213rs_allocationPDv2_sj", (void *)&SC_GetElementAt1_short2, true },
{ "_Z21rsGetElementAt_short313rs_allocationPDv3_sj", (void *)&SC_GetElementAt1_short3, true },
{ "_Z21rsGetElementAt_short413rs_allocationPDv4_sj", (void *)&SC_GetElementAt1_short4, true },
{ "_Z20rsGetElementAt_short13rs_allocationPsjj", (void *)&SC_GetElementAt2_short, true },
{ "_Z21rsGetElementAt_short213rs_allocationPDv2_sjj", (void *)&SC_GetElementAt2_short2, true },
{ "_Z21rsGetElementAt_short313rs_allocationPDv3_sjj", (void *)&SC_GetElementAt2_short3, true },
{ "_Z21rsGetElementAt_short413rs_allocationPDv4_sjj", (void *)&SC_GetElementAt2_short4, true },
{ "_Z20rsGetElementAt_short13rs_allocationPsjjj", (void *)&SC_GetElementAt3_short, true },
{ "_Z21rsGetElementAt_short213rs_allocationPDv2_sjjj", (void *)&SC_GetElementAt3_short2, true },
{ "_Z21rsGetElementAt_short313rs_allocationPDv3_sjjj", (void *)&SC_GetElementAt3_short3, true },
{ "_Z21rsGetElementAt_short413rs_allocationPDv4_sjjj", (void *)&SC_GetElementAt3_short4, true },
{ "_Z19rsGetElementAt_uint13rs_allocationPjj", (void *)&SC_GetElementAt1_uint, true },
{ "_Z20rsGetElementAt_uint213rs_allocationPDv2_jj", (void *)&SC_GetElementAt1_uint2, true },
{ "_Z20rsGetElementAt_uint313rs_allocationPDv3_jj", (void *)&SC_GetElementAt1_uint3, true },
{ "_Z20rsGetElementAt_uint413rs_allocationPDv4_jj", (void *)&SC_GetElementAt1_uint4, true },
{ "_Z19rsGetElementAt_uint13rs_allocationPjjj", (void *)&SC_GetElementAt2_uint, true },
{ "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjj", (void *)&SC_GetElementAt2_uint2, true },
{ "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjj", (void *)&SC_GetElementAt2_uint3, true },
{ "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjj", (void *)&SC_GetElementAt2_uint4, true },
{ "_Z19rsGetElementAt_uint13rs_allocationPjjjj", (void *)&SC_GetElementAt3_uint, true },
{ "_Z20rsGetElementAt_uint213rs_allocationPDv2_jjjj", (void *)&SC_GetElementAt3_uint2, true },
{ "_Z20rsGetElementAt_uint313rs_allocationPDv3_jjjj", (void *)&SC_GetElementAt3_uint3, true },
{ "_Z20rsGetElementAt_uint413rs_allocationPDv4_jjjj", (void *)&SC_GetElementAt3_uint4, true },
{ "_Z18rsGetElementAt_int13rs_allocationPij", (void *)&SC_GetElementAt1_int, true },
{ "_Z19rsGetElementAt_int213rs_allocationPDv2_ij", (void *)&SC_GetElementAt1_int2, true },
{ "_Z19rsGetElementAt_int313rs_allocationPDv3_ij", (void *)&SC_GetElementAt1_int3, true },
{ "_Z19rsGetElementAt_int413rs_allocationPDv4_ij", (void *)&SC_GetElementAt1_int4, true },
{ "_Z18rsGetElementAt_int13rs_allocationPijj", (void *)&SC_GetElementAt2_int, true },
{ "_Z19rsGetElementAt_int213rs_allocationPDv2_ijj", (void *)&SC_GetElementAt2_int2, true },
{ "_Z19rsGetElementAt_int313rs_allocationPDv3_ijj", (void *)&SC_GetElementAt2_int3, true },
{ "_Z19rsGetElementAt_int413rs_allocationPDv4_ijj", (void *)&SC_GetElementAt2_int4, true },
{ "_Z18rsGetElementAt_int13rs_allocationPijjj", (void *)&SC_GetElementAt3_int, true },
{ "_Z19rsGetElementAt_int213rs_allocationPDv2_ijjj", (void *)&SC_GetElementAt3_int2, true },
{ "_Z19rsGetElementAt_int313rs_allocationPDv3_ijjj", (void *)&SC_GetElementAt3_int3, true },
{ "_Z19rsGetElementAt_int413rs_allocationPDv4_ijjj", (void *)&SC_GetElementAt3_int4, true },
{ "_Z20rsGetElementAt_ulong13rs_allocationPmj", (void *)&SC_GetElementAt1_ulong, true },
{ "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mj", (void *)&SC_GetElementAt1_ulong2, true },
{ "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mj", (void *)&SC_GetElementAt1_ulong3, true },
{ "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mj", (void *)&SC_GetElementAt1_ulong4, true },
{ "_Z20rsGetElementAt_ulong13rs_allocationPmjj", (void *)&SC_GetElementAt2_ulong, true },
{ "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjj", (void *)&SC_GetElementAt2_ulong2, true },
{ "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjj", (void *)&SC_GetElementAt2_ulong3, true },
{ "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjj", (void *)&SC_GetElementAt2_ulong4, true },
{ "_Z20rsGetElementAt_ulong13rs_allocationPmjjj", (void *)&SC_GetElementAt3_ulong, true },
{ "_Z21rsGetElementAt_ulong213rs_allocationPDv2_mjjj", (void *)&SC_GetElementAt3_ulong2, true },
{ "_Z21rsGetElementAt_ulong313rs_allocationPDv3_mjjj", (void *)&SC_GetElementAt3_ulong3, true },
{ "_Z21rsGetElementAt_ulong413rs_allocationPDv4_mjjj", (void *)&SC_GetElementAt3_ulong4, true },
{ "_Z19rsGetElementAt_long13rs_allocationPlj", (void *)&SC_GetElementAt1_long, true },
{ "_Z20rsGetElementAt_long213rs_allocationPDv2_lj", (void *)&SC_GetElementAt1_long2, true },
{ "_Z20rsGetElementAt_long313rs_allocationPDv3_lj", (void *)&SC_GetElementAt1_long3, true },
{ "_Z20rsGetElementAt_long413rs_allocationPDv4_lj", (void *)&SC_GetElementAt1_long4, true },
{ "_Z19rsGetElementAt_long13rs_allocationPljj", (void *)&SC_GetElementAt2_long, true },
{ "_Z20rsGetElementAt_long213rs_allocationPDv2_ljj", (void *)&SC_GetElementAt2_long2, true },
{ "_Z20rsGetElementAt_long313rs_allocationPDv3_ljj", (void *)&SC_GetElementAt2_long3, true },
{ "_Z20rsGetElementAt_long413rs_allocationPDv4_ljj", (void *)&SC_GetElementAt2_long4, true },
{ "_Z19rsGetElementAt_long13rs_allocationPljjj", (void *)&SC_GetElementAt3_long, true },
{ "_Z20rsGetElementAt_long213rs_allocationPDv2_ljjj", (void *)&SC_GetElementAt3_long2, true },
{ "_Z20rsGetElementAt_long313rs_allocationPDv3_ljjj", (void *)&SC_GetElementAt3_long3, true },
{ "_Z20rsGetElementAt_long413rs_allocationPDv4_ljjj", (void *)&SC_GetElementAt3_long4, true },
{ "_Z20rsGetElementAt_float13rs_allocationPfj", (void *)&SC_GetElementAt1_float, true },
{ "_Z21rsGetElementAt_float213rs_allocationPDv2_fj", (void *)&SC_GetElementAt1_float2, true },
{ "_Z21rsGetElementAt_float313rs_allocationPDv3_fj", (void *)&SC_GetElementAt1_float3, true },
{ "_Z21rsGetElementAt_float413rs_allocationPDv4_fj", (void *)&SC_GetElementAt1_float4, true },
{ "_Z20rsGetElementAt_float13rs_allocationPfjj", (void *)&SC_GetElementAt2_float, true },
{ "_Z21rsGetElementAt_float213rs_allocationPDv2_fjj", (void *)&SC_GetElementAt2_float2, true },
{ "_Z21rsGetElementAt_float313rs_allocationPDv3_fjj", (void *)&SC_GetElementAt2_float3, true },
{ "_Z21rsGetElementAt_float413rs_allocationPDv4_fjj", (void *)&SC_GetElementAt2_float4, true },
{ "_Z20rsGetElementAt_float13rs_allocationPfjjj", (void *)&SC_GetElementAt3_float, true },
{ "_Z21rsGetElementAt_float213rs_allocationPDv2_fjjj", (void *)&SC_GetElementAt3_float2, true },
{ "_Z21rsGetElementAt_float313rs_allocationPDv3_fjjj", (void *)&SC_GetElementAt3_float3, true },
{ "_Z21rsGetElementAt_float413rs_allocationPDv4_fjjj", (void *)&SC_GetElementAt3_float4, true },
{ "_Z21rsGetElementAt_double13rs_allocationPdj", (void *)&SC_GetElementAt1_double, true },
{ "_Z22rsGetElementAt_double213rs_allocationPDv2_dj", (void *)&SC_GetElementAt1_double2, true },
{ "_Z22rsGetElementAt_double313rs_allocationPDv3_dj", (void *)&SC_GetElementAt1_double3, true },
{ "_Z22rsGetElementAt_double413rs_allocationPDv4_dj", (void *)&SC_GetElementAt1_double4, true },
{ "_Z21rsGetElementAt_double13rs_allocationPdjj", (void *)&SC_GetElementAt2_double, true },
{ "_Z22rsGetElementAt_double213rs_allocationPDv2_djj", (void *)&SC_GetElementAt2_double2, true },
{ "_Z22rsGetElementAt_double313rs_allocationPDv3_djj", (void *)&SC_GetElementAt2_double3, true },
{ "_Z22rsGetElementAt_double413rs_allocationPDv4_djj", (void *)&SC_GetElementAt2_double4, true },
{ "_Z21rsGetElementAt_double13rs_allocationPdjjj", (void *)&SC_GetElementAt3_double, true },
{ "_Z22rsGetElementAt_double213rs_allocationPDv2_djjj", (void *)&SC_GetElementAt3_double2, true },
{ "_Z22rsGetElementAt_double313rs_allocationPDv3_djjj", (void *)&SC_GetElementAt3_double3, true },
{ "_Z22rsGetElementAt_double413rs_allocationPDv4_djjj", (void *)&SC_GetElementAt3_double4, true },
{ "_Z20rsSetElementAt_uchar13rs_allocationPKhj", (void *)&SC_SetElementAt1_uchar, true },
{ "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hj", (void *)&SC_SetElementAt1_uchar2, true },
{ "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hj", (void *)&SC_SetElementAt1_uchar3, true },
{ "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hj", (void *)&SC_SetElementAt1_uchar4, true },
{ "_Z20rsSetElementAt_uchar13rs_allocationPKhjj", (void *)&SC_SetElementAt2_uchar, true },
{ "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjj", (void *)&SC_SetElementAt2_uchar2, true },
{ "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjj", (void *)&SC_SetElementAt2_uchar3, true },
{ "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjj", (void *)&SC_SetElementAt2_uchar4, true },
{ "_Z20rsSetElementAt_uchar13rs_allocationPKhjjj", (void *)&SC_SetElementAt3_uchar, true },
{ "_Z21rsSetElementAt_uchar213rs_allocationPKDv2_hjjj", (void *)&SC_SetElementAt3_uchar2, true },
{ "_Z21rsSetElementAt_uchar313rs_allocationPKDv3_hjjj", (void *)&SC_SetElementAt3_uchar3, true },
{ "_Z21rsSetElementAt_uchar413rs_allocationPKDv4_hjjj", (void *)&SC_SetElementAt3_uchar4, true },
{ "_Z19rsSetElementAt_char13rs_allocationPKcj", (void *)&SC_SetElementAt1_char, true },
{ "_Z20rsSetElementAt_char213rs_allocationPKDv2_cj", (void *)&SC_SetElementAt1_char2, true },
{ "_Z20rsSetElementAt_char313rs_allocationPKDv3_cj", (void *)&SC_SetElementAt1_char3, true },
{ "_Z20rsSetElementAt_char413rs_allocationPKDv4_cj", (void *)&SC_SetElementAt1_char4, true },
{ "_Z19rsSetElementAt_char13rs_allocationPKcjj", (void *)&SC_SetElementAt2_char, true },
{ "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjj", (void *)&SC_SetElementAt2_char2, true },
{ "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjj", (void *)&SC_SetElementAt2_char3, true },
{ "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjj", (void *)&SC_SetElementAt2_char4, true },
{ "_Z19rsSetElementAt_char13rs_allocationPKcjjj", (void *)&SC_SetElementAt3_char, true },
{ "_Z20rsSetElementAt_char213rs_allocationPKDv2_cjjj", (void *)&SC_SetElementAt3_char2, true },
{ "_Z20rsSetElementAt_char313rs_allocationPKDv3_cjjj", (void *)&SC_SetElementAt3_char3, true },
{ "_Z20rsSetElementAt_char413rs_allocationPKDv4_cjjj", (void *)&SC_SetElementAt3_char4, true },
{ "_Z21rsSetElementAt_ushort13rs_allocationPKtj", (void *)&SC_SetElementAt1_ushort, true },
{ "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tj", (void *)&SC_SetElementAt1_ushort2, true },
{ "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tj", (void *)&SC_SetElementAt1_ushort3, true },
{ "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tj", (void *)&SC_SetElementAt1_ushort4, true },
{ "_Z21rsSetElementAt_ushort13rs_allocationPKtjj", (void *)&SC_SetElementAt2_ushort, true },
{ "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjj", (void *)&SC_SetElementAt2_ushort2, true },
{ "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjj", (void *)&SC_SetElementAt2_ushort3, true },
{ "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjj", (void *)&SC_SetElementAt2_ushort4, true },
{ "_Z21rsSetElementAt_ushort13rs_allocationPKtjjj", (void *)&SC_SetElementAt3_ushort, true },
{ "_Z22rsSetElementAt_ushort213rs_allocationPKDv2_tjjj", (void *)&SC_SetElementAt3_ushort2, true },
{ "_Z22rsSetElementAt_ushort313rs_allocationPKDv3_tjjj", (void *)&SC_SetElementAt3_ushort3, true },
{ "_Z22rsSetElementAt_ushort413rs_allocationPKDv4_tjjj", (void *)&SC_SetElementAt3_ushort4, true },
{ "_Z20rsSetElementAt_short13rs_allocationPKsj", (void *)&SC_SetElementAt1_short, true },
{ "_Z21rsSetElementAt_short213rs_allocationPKDv2_sj", (void *)&SC_SetElementAt1_short2, true },
{ "_Z21rsSetElementAt_short313rs_allocationPKDv3_sj", (void *)&SC_SetElementAt1_short3, true },
{ "_Z21rsSetElementAt_short413rs_allocationPKDv4_sj", (void *)&SC_SetElementAt1_short4, true },
{ "_Z20rsSetElementAt_short13rs_allocationPKsjj", (void *)&SC_SetElementAt2_short, true },
{ "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjj", (void *)&SC_SetElementAt2_short2, true },
{ "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjj", (void *)&SC_SetElementAt2_short3, true },
{ "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjj", (void *)&SC_SetElementAt2_short4, true },
{ "_Z20rsSetElementAt_short13rs_allocationPKsjjj", (void *)&SC_SetElementAt3_short, true },
{ "_Z21rsSetElementAt_short213rs_allocationPKDv2_sjjj", (void *)&SC_SetElementAt3_short2, true },
{ "_Z21rsSetElementAt_short313rs_allocationPKDv3_sjjj", (void *)&SC_SetElementAt3_short3, true },
{ "_Z21rsSetElementAt_short413rs_allocationPKDv4_sjjj", (void *)&SC_SetElementAt3_short4, true },
{ "_Z19rsSetElementAt_uint13rs_allocationPKjj", (void *)&SC_SetElementAt1_uint, true },
{ "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jj", (void *)&SC_SetElementAt1_uint2, true },
{ "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jj", (void *)&SC_SetElementAt1_uint3, true },
{ "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jj", (void *)&SC_SetElementAt1_uint4, true },
{ "_Z19rsSetElementAt_uint13rs_allocationPKjjj", (void *)&SC_SetElementAt2_uint, true },
{ "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjj", (void *)&SC_SetElementAt2_uint2, true },
{ "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjj", (void *)&SC_SetElementAt2_uint3, true },
{ "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjj", (void *)&SC_SetElementAt2_uint4, true },
{ "_Z19rsSetElementAt_uint13rs_allocationPKjjjj", (void *)&SC_SetElementAt3_uint, true },
{ "_Z20rsSetElementAt_uint213rs_allocationPKDv2_jjjj", (void *)&SC_SetElementAt3_uint2, true },
{ "_Z20rsSetElementAt_uint313rs_allocationPKDv3_jjjj", (void *)&SC_SetElementAt3_uint3, true },
{ "_Z20rsSetElementAt_uint413rs_allocationPKDv4_jjjj", (void *)&SC_SetElementAt3_uint4, true },
{ "_Z18rsSetElementAt_int13rs_allocationPKij", (void *)&SC_SetElementAt1_int, true },
{ "_Z19rsSetElementAt_int213rs_allocationPKDv2_ij", (void *)&SC_SetElementAt1_int2, true },
{ "_Z19rsSetElementAt_int313rs_allocationPKDv3_ij", (void *)&SC_SetElementAt1_int3, true },
{ "_Z19rsSetElementAt_int413rs_allocationPKDv4_ij", (void *)&SC_SetElementAt1_int4, true },
{ "_Z18rsSetElementAt_int13rs_allocationPKijj", (void *)&SC_SetElementAt2_int, true },
{ "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijj", (void *)&SC_SetElementAt2_int2, true },
{ "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijj", (void *)&SC_SetElementAt2_int3, true },
{ "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijj", (void *)&SC_SetElementAt2_int4, true },
{ "_Z18rsSetElementAt_int13rs_allocationPKijjj", (void *)&SC_SetElementAt3_int, true },
{ "_Z19rsSetElementAt_int213rs_allocationPKDv2_ijjj", (void *)&SC_SetElementAt3_int2, true },
{ "_Z19rsSetElementAt_int313rs_allocationPKDv3_ijjj", (void *)&SC_SetElementAt3_int3, true },
{ "_Z19rsSetElementAt_int413rs_allocationPKDv4_ijjj", (void *)&SC_SetElementAt3_int4, true },
{ "_Z20rsSetElementAt_ulong13rs_allocationPKmj", (void *)&SC_SetElementAt1_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mj", (void *)&SC_SetElementAt1_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mj", (void *)&SC_SetElementAt1_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mj", (void *)&SC_SetElementAt1_ulong4, true },
{ "_Z20rsSetElementAt_ulong13rs_allocationPKmjj", (void *)&SC_SetElementAt2_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjj", (void *)&SC_SetElementAt2_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjj", (void *)&SC_SetElementAt2_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjj", (void *)&SC_SetElementAt2_ulong4, true },
{ "_Z20rsSetElementAt_ulong13rs_allocationPKmjjj", (void *)&SC_SetElementAt3_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_mjjj", (void *)&SC_SetElementAt3_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_mjjj", (void *)&SC_SetElementAt3_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_mjjj", (void *)&SC_SetElementAt3_ulong4, true },
// Pre-21 compatibility path
{ "_Z20rsSetElementAt_ulong13rs_allocationPKyj", (void *)&SC_SetElementAt1_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_yj", (void *)&SC_SetElementAt1_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_yj", (void *)&SC_SetElementAt1_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_yj", (void *)&SC_SetElementAt1_ulong4, true },
{ "_Z20rsSetElementAt_ulong13rs_allocationPKyjj", (void *)&SC_SetElementAt2_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_yjj", (void *)&SC_SetElementAt2_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_yjj", (void *)&SC_SetElementAt2_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_yjj", (void *)&SC_SetElementAt2_ulong4, true },
{ "_Z20rsSetElementAt_ulong13rs_allocationPKyjjj", (void *)&SC_SetElementAt3_ulong, true },
{ "_Z21rsSetElementAt_ulong213rs_allocationPKDv2_yjjj", (void *)&SC_SetElementAt3_ulong2, true },
{ "_Z21rsSetElementAt_ulong313rs_allocationPKDv3_yjjj", (void *)&SC_SetElementAt3_ulong3, true },
{ "_Z21rsSetElementAt_ulong413rs_allocationPKDv4_yjjj", (void *)&SC_SetElementAt3_ulong4, true },
{ "_Z19rsSetElementAt_long13rs_allocationPKlj", (void *)&SC_SetElementAt1_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_lj", (void *)&SC_SetElementAt1_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_lj", (void *)&SC_SetElementAt1_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_lj", (void *)&SC_SetElementAt1_long4, true },
{ "_Z19rsSetElementAt_long13rs_allocationPKljj", (void *)&SC_SetElementAt2_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljj", (void *)&SC_SetElementAt2_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljj", (void *)&SC_SetElementAt2_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljj", (void *)&SC_SetElementAt2_long4, true },
{ "_Z19rsSetElementAt_long13rs_allocationPKljjj", (void *)&SC_SetElementAt3_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_ljjj", (void *)&SC_SetElementAt3_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_ljjj", (void *)&SC_SetElementAt3_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_ljjj", (void *)&SC_SetElementAt3_long4, true },
// Pre-21 compatibility path
{ "_Z19rsSetElementAt_long13rs_allocationPKxj", (void *)&SC_SetElementAt1_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_xj", (void *)&SC_SetElementAt1_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_xj", (void *)&SC_SetElementAt1_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_xj", (void *)&SC_SetElementAt1_long4, true },
{ "_Z19rsSetElementAt_long13rs_allocationPKxjj", (void *)&SC_SetElementAt2_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_xjj", (void *)&SC_SetElementAt2_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_xjj", (void *)&SC_SetElementAt2_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_xjj", (void *)&SC_SetElementAt2_long4, true },
{ "_Z19rsSetElementAt_long13rs_allocationPKxjjj", (void *)&SC_SetElementAt3_long, true },
{ "_Z20rsSetElementAt_long213rs_allocationPKDv2_xjjj", (void *)&SC_SetElementAt3_long2, true },
{ "_Z20rsSetElementAt_long313rs_allocationPKDv3_xjjj", (void *)&SC_SetElementAt3_long3, true },
{ "_Z20rsSetElementAt_long413rs_allocationPKDv4_xjjj", (void *)&SC_SetElementAt3_long4, true },
{ "_Z20rsSetElementAt_float13rs_allocationPKfj", (void *)&SC_SetElementAt1_float, true },
{ "_Z21rsSetElementAt_float213rs_allocationPKDv2_fj", (void *)&SC_SetElementAt1_float2, true },
{ "_Z21rsSetElementAt_float313rs_allocationPKDv3_fj", (void *)&SC_SetElementAt1_float3, true },
{ "_Z21rsSetElementAt_float413rs_allocationPKDv4_fj", (void *)&SC_SetElementAt1_float4, true },
{ "_Z20rsSetElementAt_float13rs_allocationPKfjj", (void *)&SC_SetElementAt2_float, true },
{ "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjj", (void *)&SC_SetElementAt2_float2, true },
{ "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjj", (void *)&SC_SetElementAt2_float3, true },
{ "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjj", (void *)&SC_SetElementAt2_float4, true },
{ "_Z20rsSetElementAt_float13rs_allocationPKfjjj", (void *)&SC_SetElementAt3_float, true },
{ "_Z21rsSetElementAt_float213rs_allocationPKDv2_fjjj", (void *)&SC_SetElementAt3_float2, true },
{ "_Z21rsSetElementAt_float313rs_allocationPKDv3_fjjj", (void *)&SC_SetElementAt3_float3, true },
{ "_Z21rsSetElementAt_float413rs_allocationPKDv4_fjjj", (void *)&SC_SetElementAt3_float4, true },
{ "_Z21rsSetElementAt_double13rs_allocationPKdj", (void *)&SC_SetElementAt1_double, true },
{ "_Z22rsSetElementAt_double213rs_allocationPKDv2_dj", (void *)&SC_SetElementAt1_double2, true },
{ "_Z22rsSetElementAt_double313rs_allocationPKDv3_dj", (void *)&SC_SetElementAt1_double3, true },
{ "_Z22rsSetElementAt_double413rs_allocationPKDv4_dj", (void *)&SC_SetElementAt1_double4, true },
{ "_Z21rsSetElementAt_double13rs_allocationPKdjj", (void *)&SC_SetElementAt2_double, true },
{ "_Z22rsSetElementAt_double213rs_allocationPKDv2_djj", (void *)&SC_SetElementAt2_double2, true },
{ "_Z22rsSetElementAt_double313rs_allocationPKDv3_djj", (void *)&SC_SetElementAt2_double3, true },
{ "_Z22rsSetElementAt_double413rs_allocationPKDv4_djj", (void *)&SC_SetElementAt2_double4, true },
{ "_Z21rsSetElementAt_double13rs_allocationPKdjjj", (void *)&SC_SetElementAt3_double, true },
{ "_Z22rsSetElementAt_double213rs_allocationPKDv2_djjj", (void *)&SC_SetElementAt3_double2, true },
{ "_Z22rsSetElementAt_double313rs_allocationPKDv3_djjj", (void *)&SC_SetElementAt3_double3, true },
{ "_Z22rsSetElementAt_double413rs_allocationPKDv4_djjj", (void *)&SC_SetElementAt3_double4, true },
// Refcounting
#ifndef __LP64__
{ "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject, true },
{ "_Z10rsIsObject10rs_element", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject, true },
{ "_Z10rsIsObject7rs_type", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject, true },
{ "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject, true },
{ "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject, true },
{ "_Z10rsIsObject9rs_script", (void *)&SC_IsObject, true },
#else
{ "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_SetObject_ByRef, true },
{ "_Z10rsIsObject10rs_element", (void *)&SC_IsObject_ByRef, true },
{ "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_SetObject_ByRef, true },
{ "_Z10rsIsObject7rs_type", (void *)&SC_IsObject_ByRef, true },
{ "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_SetObject_ByRef, true },
{ "_Z10rsIsObject13rs_allocation", (void *)&SC_IsObject_ByRef, true },
{ "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_SetObject_ByRef, true },
{ "_Z10rsIsObject10rs_sampler", (void *)&SC_IsObject_ByRef, true },
{ "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_SetObject_ByRef, true },
{ "_Z10rsIsObject9rs_script", (void *)&SC_IsObject_ByRef, true },
#endif
{ "_Z13rsClearObjectP10rs_element", (void *)&SC_ClearObject, true },
{ "_Z13rsClearObjectP7rs_type", (void *)&SC_ClearObject, true },
{ "_Z13rsClearObjectP13rs_allocation", (void *)&SC_ClearObject, true },
{ "_Z13rsClearObjectP10rs_sampler", (void *)&SC_ClearObject, true },
{ "_Z13rsClearObjectP9rs_script", (void *)&SC_ClearObject, true },
{ "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP7rs_mesh", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject7rs_mesh", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject19rs_program_fragment", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject17rs_program_vertex", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject17rs_program_raster", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP16rs_program_store", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject16rs_program_store", (void *)&SC_IsObject, true },
{ "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_SetObject, true },
{ "_Z13rsClearObjectP7rs_font", (void *)&SC_ClearObject, true },
{ "_Z10rsIsObject7rs_font", (void *)&SC_IsObject, true },
// Allocation ops
{ "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_AllocationSyncAll, true },
{ "_Z20rsgAllocationSyncAll13rs_allocation", (void *)&SC_AllocationSyncAll, false },
{ "_Z20rsgAllocationSyncAll13rs_allocationj", (void *)&SC_AllocationSyncAll2, false },
{ "_Z20rsgAllocationSyncAll13rs_allocation24rs_allocation_usage_type", (void *)&SC_AllocationSyncAll2, false },
#ifndef RS_COMPATIBILITY_LIB
{ "_Z15rsGetAllocationPKv", (void *)&SC_GetAllocation, true },
{ "_Z18rsAllocationIoSend13rs_allocation", (void *)&SC_AllocationIoSend, false },
{ "_Z21rsAllocationIoReceive13rs_allocation", (void *)&SC_AllocationIoReceive, false },
#endif
{ "_Z23rsAllocationCopy1DRange13rs_allocationjjjS_jj", (void *)&SC_AllocationCopy1DRange, false },
{ "_Z23rsAllocationCopy2DRange13rs_allocationjjj26rs_allocation_cubemap_facejjS_jjjS0_", (void *)&SC_AllocationCopy2DRange, false },
// Messaging
{ "_Z14rsSendToClienti", (void *)&SC_ToClient, false },
{ "_Z14rsSendToClientiPKvj", (void *)&SC_ToClient2, false },
{ "_Z22rsSendToClientBlockingi", (void *)&SC_ToClientBlocking, false },
{ "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_ToClientBlocking2, false },
#ifndef RS_COMPATIBILITY_LIB
{ "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_BindProgramFragment, false },
{ "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_BindProgramStore, false },
{ "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_BindProgramVertex, false },
{ "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_BindProgramRaster, false },
{ "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_BindSampler, false },
{ "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_BindTexture, false },
{ "_Z15rsgBindConstant19rs_program_fragmentj13rs_allocation", (void *)&SC_BindFragmentConstant, false },
{ "_Z15rsgBindConstant17rs_program_vertexj13rs_allocation", (void *)&SC_BindVertexConstant, false },
{ "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadProjectionMatrix, false },
{ "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadModelMatrix, false },
{ "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_VpLoadTextureMatrix, false },
{ "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_VpGetProjectionMatrix, false },
{ "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_PfConstantColor, false },
{ "_Z11rsgGetWidthv", (void *)&SC_GetWidth, false },
{ "_Z12rsgGetHeightv", (void *)&SC_GetHeight, false },
{ "_Z11rsgDrawRectfffff", (void *)&SC_DrawRect, false },
{ "_Z11rsgDrawQuadffffffffffff", (void *)&SC_DrawQuad, false },
{ "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_DrawQuadTexCoords, false },
{ "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_DrawSpriteScreenspace, false },
{ "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_DrawMesh, false },
{ "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_DrawMeshPrimitive, false },
{ "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_DrawMeshPrimitiveRange, false },
{ "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_MeshComputeBoundingBox, false },
{ "_Z13rsgClearColorffff", (void *)&SC_ClearColor, false },
{ "_Z13rsgClearDepthf", (void *)&SC_ClearDepth, false },
{ "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText, false },
{ "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc, false },
{ "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText, false },
{ "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc, false },
{ "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont, false },
{ "_Z12rsgFontColorffff", (void *)&SC_FontColor, false },
{ "_Z18rsgBindColorTarget13rs_allocationj", (void *)&SC_BindFrameBufferObjectColorTarget, false },
{ "_Z18rsgBindDepthTarget13rs_allocation", (void *)&SC_BindFrameBufferObjectDepthTarget, false },
{ "_Z19rsgClearColorTargetj", (void *)&SC_ClearFrameBufferObjectColorTarget, false },
{ "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false },
{ "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false },
{ "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, true },
{ "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, true },
{ "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK14rs_script_call", (void *)&SC_ForEach_SAAUS, true },
//rsForEach with usrdata is not supported in 64-bit
#ifndef __LP64__
{ "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, true },
{ "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK14rs_script_call", (void *)&SC_ForEach_SAAULS, true },
#endif
#endif // RS_COMPATIBILITY_LIB
#ifndef __LP64__
// time
{ "_Z6rsTimePi", (void *)&SC_Time, true },
{ "_Z11rsLocaltimeP5rs_tmPKi", (void *)&SC_LocalTime, true },
#else
// time
{ "_Z6rsTimePl", (void *)&SC_Time, true },
{ "_Z11rsLocaltimeP5rs_tmPKl", (void *)&SC_LocalTime, true },
#endif
{ "_Z14rsUptimeMillisv", (void*)&SC_UptimeMillis, true },
{ "_Z13rsUptimeNanosv", (void*)&SC_UptimeNanos, true },
{ "_Z7rsGetDtv", (void*)&SC_GetDt, false },
// misc
#ifndef RS_COMPATIBILITY_LIB
{ "_Z5colorffff", (void *)&SC_Color, false },
{ "_Z9rsgFinishv", (void *)&SC_Finish, false },
#endif
{ nullptr, nullptr, false }
};
#ifndef RS_COMPATIBILITY_LIB
typedef struct { unsigned int val; } rs_allocation_usage_type;
void rsAllocationMarkDirty(::rs_allocation a) {
return SC_AllocationSyncAll(RS_CAST(a));
}
void rsgAllocationSyncAll(::rs_allocation a) {
return SC_AllocationSyncAll(RS_CAST(a));
}
void rsgAllocationSyncAll(::rs_allocation a,
unsigned int usage) {
return SC_AllocationSyncAll2(RS_CAST(a), (RsAllocationUsageType) usage);
}
void rsgAllocationSyncAll(::rs_allocation a,
rs_allocation_usage_type source) {
return SC_AllocationSyncAll2(RS_CAST(a), (RsAllocationUsageType) source.val);
}
void rsgBindProgramFragment(::rs_program_fragment pf) {
return SC_BindProgramFragment((ProgramFragment *) pf.p);
}
void rsgBindProgramStore(::rs_program_store ps) {
return SC_BindProgramStore((ProgramStore *) ps.p);
}
void rsgBindProgramVertex(::rs_program_vertex pv) {
return SC_BindProgramVertex((ProgramVertex *) pv.p);
}
void rsgBindProgramRaster(::rs_program_raster pr) {
return SC_BindProgramRaster((ProgramRaster *) pr.p);
}
void rsgBindSampler(::rs_program_fragment pf,
uint32_t slot,
::rs_sampler s) {
return SC_BindSampler((ProgramFragment *) pf.p, slot, (Sampler *) s.p);
}
void rsgBindTexture(::rs_program_fragment pf,
uint32_t slot,
::rs_allocation a) {
return SC_BindTexture((ProgramFragment *) pf.p,
slot,
(Allocation *) a.p);
}
void rsgBindConstant(::rs_program_fragment pf,
uint32_t slot,
::rs_allocation a) {
return SC_BindFragmentConstant((ProgramFragment *) pf.p,
slot,
(Allocation *) a.p);
}
void rsgBindConstant(::rs_program_vertex pv,
uint32_t slot,
::rs_allocation a) {
return SC_BindVertexConstant((ProgramVertex *) pv.p,
slot,
(Allocation *) a.p);
}
void rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4 *m) {
return SC_VpLoadProjectionMatrix((const rsc_Matrix *) m);
}
void rsgProgramVertexLoadModelMatrix(const rs_matrix4x4 *m) {
return SC_VpLoadModelMatrix((const rsc_Matrix *) m);
}
void rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4 *m) {
return SC_VpLoadTextureMatrix((const rsc_Matrix *) m);
}
void rsgProgramVertexGetProjectionMatrix(rs_matrix4x4 *m) {
return SC_VpGetProjectionMatrix((rsc_Matrix *) m);
}
void rsgProgramFragmentConstantColor(::rs_program_fragment pf,
float r, float g,
float b, float a) {
return SC_PfConstantColor((ProgramFragment *) pf.p, r, g, b, a);
}
uint32_t rsgGetWidth(void) {
return SC_GetWidth();
}
uint32_t rsgGetHeight(void) {
return SC_GetHeight();
}
void rsgDrawRect(float x1, float y1, float x2, float y2, float z) {
return SC_DrawRect(x1, y1, x2, y2, z);
}
void rsgDrawQuad(float x1, float y1, float z1,
float x2, float y2, float z2,
float x3, float y3, float z3,
float x4, float y4, float z4) {
SC_DrawQuad(x1, y1, z1,
x2, y2, z2,
x3, y3, z3,
x4, y4, z4);
}
void rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
float x2, float y2, float z2, float u2, float v2,
float x3, float y3, float z3, float u3, float v3,
float x4, float y4, float z4, float u4, float v4) {
return rsgDrawQuadTexCoords(x1, y1, z1, u1, v1,
x2, y2, z2, u2, v2,
x3, y3, z3, u3, v3,
x4, y4, z4, u4, v4);
}
void rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h) {
return SC_DrawSpriteScreenspace(x, y, z, w, h);
}
void rsgDrawMesh(::rs_mesh ism) {
return SC_DrawMesh((Mesh *) ism.p);
}
void rsgDrawMesh(::rs_mesh ism, uint primitiveIndex) {
return SC_DrawMeshPrimitive((Mesh *) ism.p, primitiveIndex);
}
void rsgDrawMesh(::rs_mesh ism, uint primitiveIndex, uint start, uint len) {
return SC_DrawMeshPrimitiveRange((Mesh *) ism.p, primitiveIndex, start, len);
}
void rsgMeshComputeBoundingBox(::rs_mesh mesh,
float *minX, float *minY, float *minZ,
float *maxX, float *maxY, float *maxZ) {
return SC_MeshComputeBoundingBox((Mesh *) mesh.p,
minX, minY, minZ,
maxX, maxY, maxZ);
}
void rsgClearColor(float r, float g, float b, float a) {
return SC_ClearColor(r, g, b, a);
}
void rsgClearDepth(float value) {
return SC_ClearDepth(value);
}
void rsgDrawText(const char *text, int x, int y) {
return SC_DrawText(text, x, y);
}
void rsgDrawText(::rs_allocation a, int x, int y) {
return SC_DrawTextAlloc((Allocation *) a.p, x, y);
}
void rsgMeasureText(const char *text, int *left, int *right,
int *top, int *bottom) {
return SC_MeasureText(text, left, right, top, bottom);
}
void rsgMeasureText(::rs_allocation a, int *left, int *right,
int *top, int *bottom) {
return SC_MeasureTextAlloc((Allocation *) a.p, left, right, top, bottom);
}
void rsgBindFont(::rs_font font) {
return SC_BindFont((Font *) font.p);
}
void rsgFontColor(float r, float g, float b, float a) {
return SC_FontColor(r, g, b, a);
}
void rsgBindColorTarget(::rs_allocation a, uint slot) {
return SC_BindFrameBufferObjectColorTarget((Allocation *) a.p, slot);
}
void rsgBindDepthTarget(::rs_allocation a) {
return SC_BindFrameBufferObjectDepthTarget((Allocation *) a.p);
}
void rsgClearColorTarget(uint slot) {
return SC_ClearFrameBufferObjectColorTarget(slot);
}
void rsgClearDepthTarget(void) {
return SC_ClearFrameBufferObjectDepthTarget(nullptr, nullptr);
}
void rsgClearAllRenderTargets(void) {
return SC_ClearFrameBufferObjectTargets(nullptr, nullptr);
}
void color(float r, float g, float b, float a) {
return SC_Color(r, g, b, a);
}
void rsgFinish(void) {
return SC_Finish();
}
#endif
//////////////////////////////////////////////////////////////////////////////
// Compatibility Library entry points
//////////////////////////////////////////////////////////////////////////////
#ifndef __LP64__
#define IS_CLEAR_SET_OBJ(t, u, v) \
bool rsIsObject(t src) { \
return src.p != nullptr; \
} \
void __attribute__((overloadable)) rsClearObject(t *dst) { \
return SC_ClearObject(reinterpret_cast<rs_object_base *>(dst)); \
} \
void __attribute__((overloadable)) rsSetObject(t *dst, t src) { \
android::renderscript::rs_object_base cast; \
cast.p = (ObjectBase *) src.p; \
return SC_SetObject(reinterpret_cast<rs_object_base *>(dst), cast);\
}
#else
#define IS_CLEAR_SET_OBJ(t, u, v) \
extern "C" { bool u(t* src) { \
return src->p != nullptr; \
} }\
void __attribute__((overloadable)) rsClearObject(t *dst) { \
return SC_ClearObject(reinterpret_cast<rs_object_base *>(dst)); \
} \
extern "C" {\
void v (t *dst, t *src) { \
return SC_SetObject_ByRef(reinterpret_cast<rs_object_base *>(dst),\
reinterpret_cast<rs_object_base *>(src));\
} }
#endif
IS_CLEAR_SET_OBJ(::rs_element, _Z10rsIsObject10rs_element, _Z11rsSetObjectP10rs_elementS_)
IS_CLEAR_SET_OBJ(::rs_type, _Z10rsIsObject7rs_type, _Z11rsSetObjectP7rs_typeS_)
IS_CLEAR_SET_OBJ(::rs_allocation, _Z10rsIsObject13rs_allocation, _Z11rsSetObjectP13rs_allocationS_)
IS_CLEAR_SET_OBJ(::rs_sampler, _Z10rsIsObject10rs_sampler, _Z11rsSetObjectP10rs_samplerS_)
IS_CLEAR_SET_OBJ(::rs_script, _Z10rsIsObject9rs_script, _Z11rsSetObjectP9rs_scriptS_)
IS_CLEAR_SET_OBJ(::rs_mesh, _Z10rsIsObject7rs_mesh, _Z11rsSetObjectP7rs_meshS_)
IS_CLEAR_SET_OBJ(::rs_program_fragment, _Z10rsIsObject19rs_program_fragment, _Z11rsSetObjectP19rs_program_fragmentS_)
IS_CLEAR_SET_OBJ(::rs_program_vertex, _Z10rsIsObject17rs_program_vertex, _Z11rsSetObjectP17rs_program_vertexS_)
IS_CLEAR_SET_OBJ(::rs_program_raster, _Z10rsIsObject17rs_program_raster, _Z11rsSetObjectP17rs_program_rasterS_)
IS_CLEAR_SET_OBJ(::rs_program_store, _Z10rsIsObject16rs_program_store, _Z11rsSetObjectP16rs_program_storeS_)
IS_CLEAR_SET_OBJ(::rs_font, _Z10rsIsObject7rs_font, _Z11rsSetObjectP7rs_fontS_)
#undef IS_CLEAR_SET_OBJ
#ifdef RS_COMPATIBILITY_LIB
static const Allocation * SC_GetAllocation(const void *ptr) {
Context *rsc = RsdCpuReference::getTlsContext();
const Script *sc = RsdCpuReference::getTlsScript();
return rsdScriptGetAllocationForPointer(rsc, sc, ptr);
}
const Allocation * rsGetAllocation(const void *ptr) {
return SC_GetAllocation(ptr);
}
#else
const android::renderscript::rs_allocation rsGetAllocation(const void *ptr) {
#ifdef __i386__
android::renderscript::rs_allocation obj;
obj.p = (Allocation *) SC_GetAllocation(ptr);
return obj;
#else
return SC_GetAllocation(ptr);
#endif
}
#endif
void __attribute__((overloadable)) rsAllocationIoSend(::rs_allocation a) {
SC_AllocationIoSend(RS_CAST(a));
}
void __attribute__((overloadable)) rsAllocationIoReceive(::rs_allocation a) {
SC_AllocationIoReceive(RS_CAST(a));
}
void __attribute__((overloadable)) rsAllocationCopy1DRange(
::rs_allocation dstAlloc,
uint32_t dstOff, uint32_t dstMip, uint32_t count,
::rs_allocation srcAlloc,
uint32_t srcOff, uint32_t srcMip) {
SC_AllocationCopy1DRange(RS_CAST(dstAlloc), dstOff, dstMip, count,
RS_CAST(srcAlloc), srcOff, srcMip);
}
void __attribute__((overloadable)) rsAllocationCopy2DRange(
::rs_allocation dstAlloc,
uint32_t dstXoff, uint32_t dstYoff,
uint32_t dstMip, rs_allocation_cubemap_face dstFace,
uint32_t width, uint32_t height,
::rs_allocation srcAlloc,
uint32_t srcXoff, uint32_t srcYoff,
uint32_t srcMip, rs_allocation_cubemap_face srcFace) {
SC_AllocationCopy2DRange(RS_CAST(dstAlloc), dstXoff, dstYoff,
dstMip, dstFace, width, height,
RS_CAST(srcAlloc), srcXoff, srcYoff,
srcMip, srcFace);
}
void __attribute__((overloadable)) rsForEach(::rs_script script,
::rs_allocation in,
::rs_allocation out,
const void *usr,
const rs_script_call *call) {
return SC_ForEach_SAAUS(RS_CAST(script), RS_CAST(in), RS_CAST(out), usr, (RsScriptCall*)call);
}
void __attribute__((overloadable)) rsForEach(::rs_script script,
::rs_allocation in,
::rs_allocation out,
const void *usr) {
return SC_ForEach_SAAU(RS_CAST(script), RS_CAST(in), RS_CAST(out), usr);
}
void __attribute__((overloadable)) rsForEach(::rs_script script,
::rs_allocation in,
::rs_allocation out) {
return SC_ForEach_SAA(RS_CAST(script), RS_CAST(in), RS_CAST(out));
}
#ifndef __LP64__
void __attribute__((overloadable)) rsForEach(::rs_script script,
::rs_allocation in,
::rs_allocation out,
const void *usr,
uint32_t usrLen) {
return SC_ForEach_SAAUL(RS_CAST(script), RS_CAST(in), RS_CAST(out), usr, usrLen);
}
void __attribute__((overloadable)) rsForEach(::rs_script script,
::rs_allocation in,
::rs_allocation out,
const void *usr,
uint32_t usrLen,
const rs_script_call *call) {
return SC_ForEach_SAAULS(RS_CAST(script), RS_CAST(in), RS_CAST(out), usr, usrLen, (RsScriptCall*)call);
}
#endif
// #if defined(RS_COMPATIBILITY_LIB) || !defined(__LP64__)
#ifndef __LP64__
int rsTime(int *timer) {
return SC_Time(timer);
}
rs_tm* rsLocaltime(rs_tm* local, const int *timer) {
return (rs_tm*)(SC_LocalTime((tm*)local, (time_t *)timer));
}
#else
time_t rsTime(time_t * timer) {
return SC_Time(timer);
}
rs_tm* rsLocaltime(rs_tm* local, const time_t *timer) {
return (rs_tm*)(SC_LocalTime((tm*)local, (time_t *)timer));
}
#endif // RS_COMPATIBILITY_LIB
int64_t rsUptimeMillis() {
Context *rsc = RsdCpuReference::getTlsContext();
return rsrUptimeMillis(rsc);
}
int64_t rsUptimeNanos() {
return SC_UptimeNanos();
}
float rsGetDt() {
return SC_GetDt();
}
uint32_t rsSendToClient(int cmdID) {
return SC_ToClient(cmdID);
}
uint32_t rsSendToClient(int cmdID, const void *data, uint32_t len) {
return SC_ToClient2(cmdID, data, len);
}
uint32_t rsSendToClientBlocking(int cmdID) {
return SC_ToClientBlocking(cmdID);
}
uint32_t rsSendToClientBlocking(int cmdID, const void *data, uint32_t len) {
return SC_ToClientBlocking2(cmdID, data, len);
}
static void SC_debugF(const char *s, float f) {
ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f)));
}
static void SC_debugFv2(const char *s, float f1, float f2) {
ALOGD("%s {%f, %f}", s, f1, f2);
}
static void SC_debugFv3(const char *s, float f1, float f2, float f3) {
ALOGD("%s {%f, %f, %f}", s, f1, f2, f3);
}
static void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) {
ALOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4);
}
static void SC_debugF2(const char *s, float2 f) {
ALOGD("%s {%f, %f}", s, f.x, f.y);
}
static void SC_debugF3(const char *s, float3 f) {
ALOGD("%s {%f, %f, %f}", s, f.x, f.y, f.z);
}
static void SC_debugF4(const char *s, float4 f) {
ALOGD("%s {%f, %f, %f, %f}", s, f.x, f.y, f.z, f.w);
}
static void SC_debugD(const char *s, double d) {
ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d)));
}
static void SC_debugD2(const char *s, double2 d) {
ALOGD("%s {%f, %f}", s, d.x, d.y);
}
static void SC_debugD3(const char *s, double3 d) {
ALOGD("%s {%f, %f, %f}", s, d.x, d.y, d.z);
}
static void SC_debugD4(const char *s, double4 d) {
ALOGD("%s {%f, %f, %f, %f}", s, d.x, d.y, d.z, d.w);
}
static void SC_debugFM4v4(const char *s, const float *f) {
ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]);
ALOGD("%s %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]);
ALOGD("%s %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]);
ALOGD("%s %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]);
}
static void SC_debugFM3v3(const char *s, const float *f) {
ALOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]);
ALOGD("%s %f, %f, %f", s, f[1], f[4], f[7]);
ALOGD("%s %f, %f, %f}",s, f[2], f[5], f[8]);
}
static void SC_debugFM2v2(const char *s, const float *f) {
ALOGD("%s {%f, %f", s, f[0], f[2]);
ALOGD("%s %f, %f}",s, f[1], f[3]);
}
static void SC_debugI8(const char *s, char c) {
ALOGD("%s %hhd 0x%hhx", s, c, (unsigned char)c);
}
static void SC_debugC2(const char *s, char2 c) {
ALOGD("%s {%hhd, %hhd} 0x%hhx 0x%hhx", s, c.x, c.y, (unsigned char)c.x, (unsigned char)c.y);
}
static void SC_debugC3(const char *s, char3 c) {
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);
}
static void SC_debugC4(const char *s, char4 c) {
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);
}
static void SC_debugU8(const char *s, unsigned char c) {
ALOGD("%s %hhu 0x%hhx", s, c, c);
}
static void SC_debugUC2(const char *s, uchar2 c) {
ALOGD("%s {%hhu, %hhu} 0x%hhx 0x%hhx", s, c.x, c.y, c.x, c.y);
}
static void SC_debugUC3(const char *s, uchar3 c) {
ALOGD("%s {%hhu, %hhu, %hhu} 0x%hhx 0x%hhx 0x%hhx", s, c.x, c.y, c.z, c.x, c.y, c.z);
}
static void SC_debugUC4(const char *s, uchar4 c) {
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);
}
static void SC_debugI16(const char *s, short c) {
ALOGD("%s %hd 0x%hx", s, c, c);
}
static void SC_debugS2(const char *s, short2 c) {
ALOGD("%s {%hd, %hd} 0x%hx 0x%hx", s, c.x, c.y, c.x, c.y);
}
static void SC_debugS3(const char *s, short3 c) {
ALOGD("%s {%hd, %hd, %hd} 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z);
}
static void SC_debugS4(const char *s, short4 c) {
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);
}
static void SC_debugU16(const char *s, unsigned short c) {
ALOGD("%s %hu 0x%hx", s, c, c);
}
static void SC_debugUS2(const char *s, ushort2 c) {
ALOGD("%s {%hu, %hu} 0x%hx 0x%hx", s, c.x, c.y, c.x, c.y);
}
static void SC_debugUS3(const char *s, ushort3 c) {
ALOGD("%s {%hu, %hu, %hu} 0x%hx 0x%hx 0x%hx", s, c.x, c.y, c.z, c.x, c.y, c.z);
}
static void SC_debugUS4(const char *s, ushort4 c) {
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);
}
static void SC_debugI32(const char *s, int32_t i) {
ALOGD("%s %d 0x%x", s, i, i);
}
static void SC_debugI2(const char *s, int2 i) {
ALOGD("%s {%d, %d} 0x%x 0x%x", s, i.x, i.y, i.x, i.y);
}
static void SC_debugI3(const char *s, int3 i) {
ALOGD("%s {%d, %d, %d} 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z);
}
static void SC_debugI4(const char *s, int4 i) {
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);
}
static void SC_debugU32(const char *s, uint32_t i) {
ALOGD("%s %u 0x%x", s, i, i);
}
static void SC_debugUI2(const char *s, uint2 i) {
ALOGD("%s {%u, %u} 0x%x 0x%x", s, i.x, i.y, i.x, i.y);
}
static void SC_debugUI3(const char *s, uint3 i) {
ALOGD("%s {%u, %u, %u} 0x%x 0x%x 0x%x", s, i.x, i.y, i.z, i.x, i.y, i.z);
}
static void SC_debugUI4(const char *s, uint4 i) {
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);
}
template <typename T>
static inline long long LL(const T &x) {
return static_cast<long long>(x);
}
template <typename T>
static inline unsigned long long LLu(const T &x) {
return static_cast<unsigned long long>(x);
}
static void SC_debugLL64(const char *s, long long ll) {
ALOGD("%s %lld 0x%llx", s, LL(ll), LL(ll));
}
static void SC_debugL2(const char *s, long2 ll) {
ALOGD("%s {%lld, %lld} 0x%llx 0x%llx", s, LL(ll.x), LL(ll.y), LL(ll.x), LL(ll.y));
}
static void SC_debugL3(const char *s, long3 ll) {
ALOGD("%s {%lld, %lld, %lld} 0x%llx 0x%llx 0x%llx", s, LL(ll.x), LL(ll.y), LL(ll.z), LL(ll.x), LL(ll.y), LL(ll.z));
}
static void SC_debugL4(const char *s, long4 ll) {
ALOGD("%s {%lld, %lld, %lld, %lld} 0x%llx 0x%llx 0x%llx 0x%llx", s, LL(ll.x), LL(ll.y), LL(ll.z), LL(ll.w), LL(ll.x), LL(ll.y), LL(ll.z), LL(ll.w));
}
static void SC_debugULL64(const char *s, unsigned long long ll) {
ALOGD("%s %llu 0x%llx", s, ll, ll);
}
static void SC_debugUL2(const char *s, ulong2 ll) {
ALOGD("%s {%llu, %llu} 0x%llx 0x%llx", s, LLu(ll.x), LLu(ll.y), LLu(ll.x), LLu(ll.y));
}
static void SC_debugUL3(const char *s, ulong3 ll) {
ALOGD("%s {%llu, %llu, %llu} 0x%llx 0x%llx 0x%llx", s, LLu(ll.x), LLu(ll.y), LLu(ll.z), LLu(ll.x), LLu(ll.y), LLu(ll.z));
}
static void SC_debugUL4(const char *s, ulong4 ll) {
ALOGD("%s {%llu, %llu, %llu, %llu} 0x%llx 0x%llx 0x%llx 0x%llx", s, LLu(ll.x), LLu(ll.y), LLu(ll.z), LLu(ll.w), LLu(ll.x), LLu(ll.y), LLu(ll.z), LLu(ll.w));
}
static void SC_debugP(const char *s, const void *p) {
ALOGD("%s %p", s, p);
}
// TODO: allocation ops, messaging, time
void rsDebug(const char *s, float f) {
SC_debugF(s, f);
}
void rsDebug(const char *s, float f1, float f2) {
SC_debugFv2(s, f1, f2);
}
void rsDebug(const char *s, float f1, float f2, float f3) {
SC_debugFv3(s, f1, f2, f3);
}
void rsDebug(const char *s, float f1, float f2, float f3, float f4) {
SC_debugFv4(s, f1, f2, f3, f4);
}
void rsDebug(const char *s, const float2 *f) {
SC_debugF2(s, *f);
}
void rsDebug(const char *s, const float3 *f) {
SC_debugF3(s, *f);
}
void rsDebug(const char *s, const float4 *f) {
SC_debugF4(s, *f);
}
void rsDebug(const char *s, double d) {
SC_debugD(s, d);
}
void rsDebug(const char *s, const double2 *d) {
SC_debugD2(s, *d);
}
void rsDebug(const char *s, const double3 *d) {
SC_debugD3(s, *d);
}
void rsDebug(const char *s, const double4 *d) {
SC_debugD4(s, *d);
}
void rsDebug(const char *s, const rs_matrix4x4 *m) {
SC_debugFM4v4(s, (float *) m);
}
void rsDebug(const char *s, const rs_matrix3x3 *m) {
SC_debugFM3v3(s, (float *) m);
}
void rsDebug(const char *s, const rs_matrix2x2 *m) {
SC_debugFM2v2(s, (float *) m);
}
void rsDebug(const char *s, char c) {
SC_debugI8(s, c);
}
void rsDebug(const char *s, const char2 *c) {
SC_debugC2(s, *c);
}
void rsDebug(const char *s, const char3 *c) {
SC_debugC3(s, *c);
}
void rsDebug(const char *s, const char4 *c) {
SC_debugC4(s, *c);
}
void rsDebug(const char *s, unsigned char c) {
SC_debugU8(s, c);
}
void rsDebug(const char *s, const uchar2 *c) {
SC_debugUC2(s, *c);
}
void rsDebug(const char *s, const uchar3 *c) {
SC_debugUC3(s, *c);
}
void rsDebug(const char *s, const uchar4 *c) {
SC_debugUC4(s, *c);
}
void rsDebug(const char *s, short c) {
SC_debugI16(s, c);
}
void rsDebug(const char *s, const short2 *c) {
SC_debugS2(s, *c);
}
void rsDebug(const char *s, const short3 *c) {
SC_debugS3(s, *c);
}
void rsDebug(const char *s, const short4 *c) {
SC_debugS4(s, *c);
}
void rsDebug(const char *s, unsigned short c) {
SC_debugU16(s, c);
}
void rsDebug(const char *s, const ushort2 *c) {
SC_debugUS2(s, *c);
}
void rsDebug(const char *s, const ushort3 *c) {
SC_debugUS3(s, *c);
}
void rsDebug(const char *s, const ushort4 *c) {
SC_debugUS4(s, *c);
}
void rsDebug(const char *s, int c) {
SC_debugI32(s, c);
}
void rsDebug(const char *s, const int2 *c) {
SC_debugI2(s, *c);
}
void rsDebug(const char *s, const int3 *c) {
SC_debugI3(s, *c);
}
void rsDebug(const char *s, const int4 *c) {
SC_debugI4(s, *c);
}
void rsDebug(const char *s, unsigned int c) {
SC_debugU32(s, c);
}
void rsDebug(const char *s, const uint2 *c) {
SC_debugUI2(s, *c);
}
void rsDebug(const char *s, const uint3 *c) {
SC_debugUI3(s, *c);
}
void rsDebug(const char *s, const uint4 *c) {
SC_debugUI4(s, *c);
}
void rsDebug(const char *s, long c) {
SC_debugLL64(s, c);
}
void rsDebug(const char *s, long long c) {
SC_debugLL64(s, c);
}
void rsDebug(const char *s, const long2 *c) {
SC_debugL2(s, *c);
}
void rsDebug(const char *s, const long3 *c) {
SC_debugL3(s, *c);
}
void rsDebug(const char *s, const long4 *c) {
SC_debugL4(s, *c);
}
void rsDebug(const char *s, unsigned long c) {
SC_debugULL64(s, c);
}
void rsDebug(const char *s, unsigned long long c) {
SC_debugULL64(s, c);
}
void rsDebug(const char *s, const ulong2 *c) {
SC_debugUL2(s, *c);
}
void rsDebug(const char *s, const ulong3 *c) {
SC_debugUL3(s, *c);
}
void rsDebug(const char *s, const ulong4 *c) {
SC_debugUL4(s, *c);
}
// FIXME: We need to export these function signatures for the compatibility
// library. The C++ name mangling that LLVM uses for ext_vector_type requires
// different versions for "long" vs. "long long". Note that the called
// functions are still using the appropriate 64-bit sizes.
#ifndef __LP64__
typedef long l2 __attribute__((ext_vector_type(2)));
typedef long l3 __attribute__((ext_vector_type(3)));
typedef long l4 __attribute__((ext_vector_type(4)));
typedef unsigned long ul2 __attribute__((ext_vector_type(2)));
typedef unsigned long ul3 __attribute__((ext_vector_type(3)));
typedef unsigned long ul4 __attribute__((ext_vector_type(4)));
void rsDebug(const char *s, const l2 *c) {
SC_debugL2(s, *(const long2 *)c);
}
void rsDebug(const char *s, const l3 *c) {
SC_debugL3(s, *(const long3 *)c);
}
void rsDebug(const char *s, const l4 *c) {
SC_debugL4(s, *(const long4 *)c);
}
void rsDebug(const char *s, const ul2 *c) {
SC_debugUL2(s, *(const ulong2 *)c);
}
void rsDebug(const char *s, const ul3 *c) {
SC_debugUL3(s, *(const ulong3 *)c);
}
void rsDebug(const char *s, const ul4 *c) {
SC_debugUL4(s, *(const ulong4 *)c);
}
#endif
void rsDebug(const char *s, const long2 c) {
SC_debugL2(s, c);
}
void rsDebug(const char *s, const long3 c) {
SC_debugL3(s, c);
}
void rsDebug(const char *s, const long4 c) {
SC_debugL4(s, c);
}
void rsDebug(const char *s, const ulong2 c) {
SC_debugUL2(s, c);
}
void rsDebug(const char *s, const ulong3 c) {
SC_debugUL3(s, c);
}
void rsDebug(const char *s, const ulong4 c) {
SC_debugUL4(s, c);
}
void rsDebug(const char *s, const void *p) {
SC_debugP(s, p);
}
extern const RsdCpuReference::CpuSymbol * rsdLookupRuntimeStub(Context * pContext, char const* name) {
ScriptC *s = (ScriptC *)pContext;
const RsdCpuReference::CpuSymbol *syms = gSyms;
const RsdCpuReference::CpuSymbol *sym = nullptr;
if (!sym) {
while (syms->fnPtr) {
if (!strcmp(syms->name, name)) {
return syms;
}
syms++;
}
}
return nullptr;
}