diff options
author | Jason Sams <rjsams@android.com> | 2011-07-27 14:10:53 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2011-07-27 14:10:53 -0700 |
commit | 4575a8e4de2cd5486dfd5b6afb701c7f167ff508 (patch) | |
tree | 95eafad11849ac332c691b60544dfc32e77b0687 | |
parent | bce8effe75c5477eb42d4e1c4df609da962285a2 (diff) | |
download | frameworks_base-4575a8e4de2cd5486dfd5b6afb701c7f167ff508.zip frameworks_base-4575a8e4de2cd5486dfd5b6afb701c7f167ff508.tar.gz frameworks_base-4575a8e4de2cd5486dfd5b6afb701c7f167ff508.tar.bz2 |
Add const to matrix by vector multiply routines.
Cleanup ifdef for rsForEach.
Change-Id: Id0d053f5dc73fef7dffed57ed02e90340b6cb798
-rw-r--r-- | libs/rs/scriptc/rs_core.rsh | 20 | ||||
-rw-r--r-- | libs/rs/scriptc/rs_math.rsh | 21 |
2 files changed, 30 insertions, 11 deletions
diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index 4768bbe..d939fb3 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -269,6 +269,7 @@ rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, floa extern void __attribute__((overloadable)) rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far); +#if !defined(RS_VERSION) || (RS_VERSION < 14) _RS_RUNTIME float4 __attribute__((overloadable)) rsMatrixMultiply(rs_matrix4x4 *m, float4 in); @@ -286,6 +287,25 @@ rsMatrixMultiply(rs_matrix3x3 *m, float2 in); _RS_RUNTIME float2 __attribute__((overloadable)) rsMatrixMultiply(rs_matrix2x2 *m, float2 in); +#else +_RS_RUNTIME float4 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix4x4 *m, float4 in); + +_RS_RUNTIME float4 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix4x4 *m, float3 in); + +_RS_RUNTIME float4 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix4x4 *m, float2 in); + +_RS_RUNTIME float3 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix3x3 *m, float3 in); + +_RS_RUNTIME float3 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix3x3 *m, float2 in); + +_RS_RUNTIME float2 __attribute__((overloadable)) +rsMatrixMultiply(const rs_matrix2x2 *m, float2 in); +#endif // Returns true if the matrix was successfully inversed extern bool __attribute__((overloadable)) rsMatrixInverse(rs_matrix4x4 *m); diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh index fb5c4f6..1d36cc6 100644 --- a/libs/rs/scriptc/rs_math.rsh +++ b/libs/rs/scriptc/rs_math.rsh @@ -249,7 +249,16 @@ typedef struct rs_script_call { uint32_t arrayEnd; } rs_script_call_t; -#if 1//(RS_VERSION >= 14) +#if !defined(RS_VERSION) || (RS_VERSION < 14) +extern void __attribute__((overloadable)) + rsForEach(rs_script script, rs_allocation input, + rs_allocation output, const void * usrData, + const rs_script_call_t *); + +extern void __attribute__((overloadable)) + rsForEach(rs_script script, rs_allocation input, + rs_allocation output, const void * usrData); +#else extern void __attribute__((overloadable)) rsForEach(rs_script script, rs_allocation input, rs_allocation output); @@ -260,18 +269,8 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void * usrData, size_t usrDataLen, const rs_script_call_t *); -#else -extern void __attribute__((overloadable)) - rsForEach(rs_script script, rs_allocation input, - rs_allocation output, const void * usrData, - const rs_script_call_t *); #endif -// Move me once dependant changes are in. -extern void __attribute__((overloadable)) - rsForEach(rs_script script, rs_allocation input, - rs_allocation output, const void * usrData); - /** * Atomic add one to the value at addr. |