summaryrefslogtreecommitdiffstats
path: root/libs/rs
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2010-10-18 11:45:15 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-18 11:45:16 -0700
commit2cd6f4709c6c260bfde999d7fe5364e88ee46b53 (patch)
treedc1bf3f26629961f4a41357be5a090a0c21e84fa /libs/rs
parenta6fdc38b243233a7be0d0eca46ff98e17ebb6c3a (diff)
parent6568896117197216de4877a31c382c7769617a10 (diff)
downloadframeworks_base-2cd6f4709c6c260bfde999d7fe5364e88ee46b53.zip
frameworks_base-2cd6f4709c6c260bfde999d7fe5364e88ee46b53.tar.gz
frameworks_base-2cd6f4709c6c260bfde999d7fe5364e88ee46b53.tar.bz2
Merge "Add support for rsDebug with 64-bit types."
Diffstat (limited to 'libs/rs')
-rw-r--r--libs/rs/rsScriptC_Lib.cpp19
-rw-r--r--libs/rs/scriptc/rs_core.rsh14
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,