diff options
author | Stephen Hines <srhines@google.com> | 2010-10-15 12:47:49 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2010-10-15 14:17:55 -0700 |
commit | 6568896117197216de4877a31c382c7769617a10 (patch) | |
tree | dc7ed134725e5a93dfd450b706c2efb658969809 /libs/rs | |
parent | db3694d03068aca596feee7326d3c14eb71d8dc9 (diff) | |
download | frameworks_base-6568896117197216de4877a31c382c7769617a10.zip frameworks_base-6568896117197216de4877a31c382c7769617a10.tar.gz frameworks_base-6568896117197216de4877a31c382c7769617a10.tar.bz2 |
Add support for rsDebug with 64-bit types.
Bug: 3099081
Change-Id: Ieb3af7757489876ef951be8527aa73f69e1481fd
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 19 | ||||
-rw-r--r-- | libs/rs/scriptc/rs_core.rsh | 14 |
2 files changed, 30 insertions, 3 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index e0de867..9fadee0 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -307,6 +307,9 @@ static void SC_debugFv3(const char *s, float f1, float f2, float f3) { static void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) { LOGE("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4); } +static void SC_debugD(const char *s, double d) { + LOGE("%s %f, 0x%08llx", s, d, *((long long *) (&d))); +} static void SC_debugFM4v4(const char *s, const float *f) { LOGE("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]); LOGE("%s %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]); @@ -327,7 +330,13 @@ static void SC_debugI32(const char *s, int32_t i) { LOGE("%s %i 0x%x", s, i, i); } static void SC_debugU32(const char *s, uint32_t i) { - LOGE("%s %i 0x%x", s, i, i); + LOGE("%s %u 0x%x", s, i, i); +} +static void SC_debugLL64(const char *s, long long ll) { + LOGE("%s %lld 0x%llx", s, ll, ll); +} +static void SC_debugULL64(const char *s, unsigned long long ll) { + LOGE("%s %llu 0x%llx", s, ll, ll); } static void SC_debugP(const char *s, const void *p) { @@ -494,11 +503,19 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z7rsDebugPKcff", (void *)&SC_debugFv2 }, { "_Z7rsDebugPKcfff", (void *)&SC_debugFv3 }, { "_Z7rsDebugPKcffff", (void *)&SC_debugFv4 }, + { "_Z7rsDebugPKcd", (void *)&SC_debugD }, { "_Z7rsDebugPKcPK12rs_matrix4x4", (void *)&SC_debugFM4v4 }, { "_Z7rsDebugPKcPK12rs_matrix3x3", (void *)&SC_debugFM3v3 }, { "_Z7rsDebugPKcPK12rs_matrix2x2", (void *)&SC_debugFM2v2 }, { "_Z7rsDebugPKci", (void *)&SC_debugI32 }, { "_Z7rsDebugPKcj", (void *)&SC_debugU32 }, + // Both "long" and "unsigned long" need to be redirected to their + // 64-bit counterparts, since we have hacked Slang to use 64-bit + // for "long" on Arm (to be similar to Java). + { "_Z7rsDebugPKcl", (void *)&SC_debugLL64 }, + { "_Z7rsDebugPKcm", (void *)&SC_debugULL64 }, + { "_Z7rsDebugPKcx", (void *)&SC_debugLL64 }, + { "_Z7rsDebugPKcy", (void *)&SC_debugULL64 }, { "_Z7rsDebugPKcPKv", (void *)&SC_debugP }, // RS Math diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index 9950184..0e0532c 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -11,6 +11,8 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsDebug(const char *, float, float, float, float); extern void __attribute__((overloadable)) + rsDebug(const char *, double); +extern void __attribute__((overloadable)) rsDebug(const char *, const rs_matrix4x4 *); extern void __attribute__((overloadable)) rsDebug(const char *, const rs_matrix3x3 *); @@ -21,6 +23,14 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsDebug(const char *, uint); extern void __attribute__((overloadable)) + rsDebug(const char *, long); +extern void __attribute__((overloadable)) + rsDebug(const char *, unsigned long); +extern void __attribute__((overloadable)) + rsDebug(const char *, long long); +extern void __attribute__((overloadable)) + rsDebug(const char *, unsigned long long); +extern void __attribute__((overloadable)) rsDebug(const char *, const void *); #define RS_DEBUG(a) rsDebug(#a, a) #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) @@ -803,7 +813,7 @@ static void rsQuaternionGetMatrixUnit(rs_matrix4x4 *m, const rs_quaternion *q) { ///////////////////////////////////////////////////// // utility funcs ///////////////////////////////////////////////////// -void __attribute__((overloadable)) +__inline__ static void __attribute__((overloadable, always_inline)) rsExtractFrustumPlanes(const rs_matrix4x4 *modelViewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, @@ -853,7 +863,7 @@ rsExtractFrustumPlanes(const rs_matrix4x4 *modelViewProj, *far /= len; } -bool __attribute__((overloadable)) +__inline__ static bool __attribute__((overloadable, always_inline)) rsIsSphereInFrustum(float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, |