summaryrefslogtreecommitdiffstats
path: root/renderscript
diff options
context:
space:
mode:
Diffstat (limited to 'renderscript')
-rw-r--r--renderscript/clang-include/module.map156
-rw-r--r--renderscript/include/rs_allocation.rsh2
-rw-r--r--renderscript/include/rs_atomic.rsh2
-rw-r--r--renderscript/include/rs_core_math.rsh316
-rw-r--r--renderscript/include/rs_matrix.rsh308
-rw-r--r--renderscript/include/rs_types.rsh12
-rw-r--r--renderscript/lib/arm/libclcore.bcbin235304 -> 237372 bytes
-rw-r--r--renderscript/lib/mips/libclcore.bcbin235304 -> 237372 bytes
-rw-r--r--renderscript/lib/x86/libclcore.bcbin231540 -> 233608 bytes
9 files changed, 565 insertions, 231 deletions
diff --git a/renderscript/clang-include/module.map b/renderscript/clang-include/module.map
new file mode 100644
index 0000000..9f7944d
--- /dev/null
+++ b/renderscript/clang-include/module.map
@@ -0,0 +1,156 @@
+module _Builtin_intrinsics [system] {
+ explicit module altivec {
+ requires altivec
+ header "altivec.h"
+ }
+
+ explicit module arm {
+ requires arm
+
+ explicit module neon {
+ requires neon
+ header "arm_neon.h"
+ export *
+ }
+ }
+
+ explicit module intel {
+ requires x86
+ export *
+
+ header "immintrin.h"
+ header "x86intrin.h"
+
+ explicit module mm_malloc {
+ header "mm_malloc.h"
+ export * // note: for <stdlib.h> dependency
+ }
+
+ explicit module cpuid {
+ requires x86
+ header "cpuid.h"
+ }
+
+ explicit module mmx {
+ requires mmx
+ header "mmintrin.h"
+ }
+
+ explicit module f16c {
+ requires f16c
+ header "f16cintrin.h"
+ }
+
+ explicit module sse {
+ requires sse
+ export mmx
+ export * // note: for hackish <emmintrin.h> dependency
+ header "xmmintrin.h"
+ }
+
+ explicit module sse2 {
+ requires sse2
+ export sse
+ header "emmintrin.h"
+ }
+
+ explicit module sse3 {
+ requires sse3
+ export sse2
+ header "pmmintrin.h"
+ }
+
+ explicit module ssse3 {
+ requires ssse3
+ export sse3
+ header "tmmintrin.h"
+ }
+
+ explicit module sse4_1 {
+ requires sse41
+ export ssse3
+ header "smmintrin.h"
+ }
+
+ explicit module sse4_2 {
+ requires sse42
+ export sse4_1
+ header "nmmintrin.h"
+ }
+
+ explicit module sse4a {
+ requires sse4a
+ export sse3
+ header "ammintrin.h"
+ }
+
+ explicit module avx {
+ requires avx
+ export sse4_2
+ header "avxintrin.h"
+ }
+
+ explicit module avx2 {
+ requires avx2
+ export avx
+ header "avx2intrin.h"
+ }
+
+ explicit module bmi {
+ requires bmi
+ header "bmiintrin.h"
+ }
+
+ explicit module bmi2 {
+ requires bmi2
+ header "bmi2intrin.h"
+ }
+
+ explicit module fma {
+ requires fma
+ header "fmaintrin.h"
+ }
+
+ explicit module fma4 {
+ requires fma4
+ export sse3
+ header "fma4intrin.h"
+ }
+
+ explicit module lzcnt {
+ requires lzcnt
+ header "lzcntintrin.h"
+ }
+
+ explicit module popcnt {
+ requires popcnt
+ header "popcntintrin.h"
+ }
+
+ explicit module mm3dnow {
+ requires mm3dnow
+ header "mm3dnow.h"
+ }
+
+ explicit module xop {
+ requires xop
+ export fma4
+ header "xopintrin.h"
+ }
+
+ explicit module aes_pclmul {
+ requires aes, pclmul
+ header "wmmintrin.h"
+ }
+
+ explicit module aes {
+ requires aes
+ header "__wmmintrin_aes.h"
+ }
+
+ explicit module pclmul {
+ requires pclmul
+ header "__wmmintrin_pclmul.h"
+ }
+ }
+}
diff --git a/renderscript/include/rs_allocation.rsh b/renderscript/include/rs_allocation.rsh
index 773c386..6f3f8d9 100644
--- a/renderscript/include/rs_allocation.rsh
+++ b/renderscript/include/rs_allocation.rsh
@@ -375,7 +375,7 @@ extern const uchar __attribute__((overloadable))
#endif // (defined(RS_VERSION) && (RS_VERSION >= 18))
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+#if (defined(RS_VERSION) && (RS_VERSION >= 999))
#define VOP(T) \
extern T __attribute__((overloadable)) \
diff --git a/renderscript/include/rs_atomic.rsh b/renderscript/include/rs_atomic.rsh
index fef05bb..ba847cf 100644
--- a/renderscript/include/rs_atomic.rsh
+++ b/renderscript/include/rs_atomic.rsh
@@ -177,7 +177,7 @@ extern uint32_t __attribute__((overloadable))
#endif //defined(RS_VERSION) && (RS_VERSION >= 14)
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20)) // TODO: api 21
/**
* Atomic add one to the value at addr.
diff --git a/renderscript/include/rs_core_math.rsh b/renderscript/include/rs_core_math.rsh
index c7cc331..287a1b9 100644
--- a/renderscript/include/rs_core_math.rsh
+++ b/renderscript/include/rs_core_math.rsh
@@ -456,7 +456,7 @@ extern float4 __attribute__((const, overloadable))atan2pi(float4 y, float4 x);
*
* Supported by API versions 9 and newer.
*/
-extern float __attribute__((const, overloadable))atanh(float);
+extern float __attribute__((const, overloadable))atanh(float v);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -465,7 +465,7 @@ extern float __attribute__((const, overloadable))atanh(float);
*
* Supported by API versions 9 and newer.
*/
-extern float2 __attribute__((const, overloadable))atanh(float2);
+extern float2 __attribute__((const, overloadable))atanh(float2 v);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -474,7 +474,7 @@ extern float2 __attribute__((const, overloadable))atanh(float2);
*
* Supported by API versions 9 and newer.
*/
-extern float3 __attribute__((const, overloadable))atanh(float3);
+extern float3 __attribute__((const, overloadable))atanh(float3 v);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -483,7 +483,7 @@ extern float3 __attribute__((const, overloadable))atanh(float3);
*
* Supported by API versions 9 and newer.
*/
-extern float4 __attribute__((const, overloadable))atanh(float4);
+extern float4 __attribute__((const, overloadable))atanh(float4 v);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -5667,7 +5667,7 @@ extern float __attribute__((const, overloadable))length(float4 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the log gamma and sign
+ * Return the log gamma
*
* Supported by API versions 9 and newer.
*/
@@ -5676,7 +5676,7 @@ extern float __attribute__((const, overloadable))lgamma(float);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the log gamma and sign
+ * Return the log gamma
*
* Supported by API versions 9 and newer.
*/
@@ -5685,7 +5685,7 @@ extern float2 __attribute__((const, overloadable))lgamma(float2);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the log gamma and sign
+ * Return the log gamma
*
* Supported by API versions 9 and newer.
*/
@@ -5694,7 +5694,7 @@ extern float3 __attribute__((const, overloadable))lgamma(float3);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the log gamma and sign
+ * Return the log gamma
*
* Supported by API versions 9 and newer.
*/
@@ -6325,290 +6325,290 @@ static uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2) {
}
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char __attribute__((const, overloadable))max(char v1, char v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char2 __attribute__((const, overloadable))max(char2 v1, char2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char3 __attribute__((const, overloadable))max(char3 v1, char3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char4 __attribute__((const, overloadable))max(char4 v1, char4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar __attribute__((const, overloadable))max(uchar v1, uchar v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar2 __attribute__((const, overloadable))max(uchar2 v1, uchar2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar3 __attribute__((const, overloadable))max(uchar3 v1, uchar3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar4 __attribute__((const, overloadable))max(uchar4 v1, uchar4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short __attribute__((const, overloadable))max(short v1, short v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short2 __attribute__((const, overloadable))max(short2 v1, short2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short3 __attribute__((const, overloadable))max(short3 v1, short3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short4 __attribute__((const, overloadable))max(short4 v1, short4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort __attribute__((const, overloadable))max(ushort v1, ushort v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort2 __attribute__((const, overloadable))max(ushort2 v1, ushort2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort3 __attribute__((const, overloadable))max(ushort3 v1, ushort3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort4 __attribute__((const, overloadable))max(ushort4 v1, ushort4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int __attribute__((const, overloadable))max(int v1, int v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int2 __attribute__((const, overloadable))max(int2 v1, int2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int3 __attribute__((const, overloadable))max(int3 v1, int3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int4 __attribute__((const, overloadable))max(int4 v1, int4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint __attribute__((const, overloadable))max(uint v1, uint v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint2 __attribute__((const, overloadable))max(uint2 v1, uint2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint3 __attribute__((const, overloadable))max(uint3 v1, uint3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long __attribute__((const, overloadable))max(long v1, long v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long2 __attribute__((const, overloadable))max(long2 v1, long2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long3 __attribute__((const, overloadable))max(long3 v1, long3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long4 __attribute__((const, overloadable))max(long4 v1, long4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong __attribute__((const, overloadable))max(ulong v1, ulong v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong2 __attribute__((const, overloadable))max(ulong2 v1, ulong2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong3 __attribute__((const, overloadable))max(ulong3 v1, ulong3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the maximum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong4 __attribute__((const, overloadable))max(ulong4 v1, ulong4 v2);
#endif
@@ -6985,290 +6985,290 @@ static uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2) {
}
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char __attribute__((const, overloadable))min(char v1, char v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char2 __attribute__((const, overloadable))min(char2 v1, char2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char3 __attribute__((const, overloadable))min(char3 v1, char3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern char4 __attribute__((const, overloadable))min(char4 v1, char4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar __attribute__((const, overloadable))min(uchar v1, uchar v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short __attribute__((const, overloadable))min(short v1, short v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short2 __attribute__((const, overloadable))min(short2 v1, short2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short3 __attribute__((const, overloadable))min(short3 v1, short3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern short4 __attribute__((const, overloadable))min(short4 v1, short4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort __attribute__((const, overloadable))min(ushort v1, ushort v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int __attribute__((const, overloadable))min(int v1, int v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int2 __attribute__((const, overloadable))min(int2 v1, int2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int3 __attribute__((const, overloadable))min(int3 v1, int3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern int4 __attribute__((const, overloadable))min(int4 v1, int4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint __attribute__((const, overloadable))min(uint v1, uint v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long __attribute__((const, overloadable))min(long v1, long v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long2 __attribute__((const, overloadable))min(long2 v1, long2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long3 __attribute__((const, overloadable))min(long3 v1, long3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern long4 __attribute__((const, overloadable))min(long4 v1, long4 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong __attribute__((const, overloadable))min(ulong v1, ulong v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong2 __attribute__((const, overloadable))min(ulong2 v1, ulong2 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong3 __attribute__((const, overloadable))min(ulong3 v1, ulong3 v2);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* Return the minimum value from two arguments
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern ulong4 __attribute__((const, overloadable))min(ulong4 v1, ulong4 v2);
#endif
@@ -7727,7 +7727,7 @@ extern float4 __attribute__((const, overloadable))native_atan2pi(float4 y, float
*
* Supported by API versions 21 and newer.
*/
-extern float __attribute__((const, overloadable))native_atanh(float);
+extern float __attribute__((const, overloadable))native_atanh(float in);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
@@ -7736,7 +7736,7 @@ extern float __attribute__((const, overloadable))native_atanh(float);
*
* Supported by API versions 21 and newer.
*/
-extern float2 __attribute__((const, overloadable))native_atanh(float2);
+extern float2 __attribute__((const, overloadable))native_atanh(float2 in);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
@@ -7745,7 +7745,7 @@ extern float2 __attribute__((const, overloadable))native_atanh(float2);
*
* Supported by API versions 21 and newer.
*/
-extern float3 __attribute__((const, overloadable))native_atanh(float3);
+extern float3 __attribute__((const, overloadable))native_atanh(float3 in);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
@@ -7754,7 +7754,7 @@ extern float3 __attribute__((const, overloadable))native_atanh(float3);
*
* Supported by API versions 21 and newer.
*/
-extern float4 __attribute__((const, overloadable))native_atanh(float4);
+extern float4 __attribute__((const, overloadable))native_atanh(float4 in);
#endif
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
@@ -8252,6 +8252,7 @@ extern float __attribute__((const, overloadable))native_length(float4 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8261,6 +8262,7 @@ extern float __attribute__((const, overloadable))native_log(float v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8270,6 +8272,7 @@ extern float2 __attribute__((const, overloadable))native_log(float2 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8279,6 +8282,7 @@ extern float3 __attribute__((const, overloadable))native_log(float3 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8288,6 +8292,7 @@ extern float4 __attribute__((const, overloadable))native_log(float4 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log10
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8297,6 +8302,7 @@ extern float __attribute__((const, overloadable))native_log10(float v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log10
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8306,6 +8312,7 @@ extern float2 __attribute__((const, overloadable))native_log10(float2 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log10
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8315,6 +8322,7 @@ extern float3 __attribute__((const, overloadable))native_log10(float3 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log10
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8360,6 +8368,7 @@ extern float4 __attribute__((const, overloadable))native_log1p(float4);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log2
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8369,6 +8378,7 @@ extern float __attribute__((const, overloadable))native_log2(float v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log2
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8378,6 +8388,7 @@ extern float2 __attribute__((const, overloadable))native_log2(float2 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log2
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8387,6 +8398,7 @@ extern float3 __attribute__((const, overloadable))native_log2(float3 v);
#if (defined(RS_VERSION) && (RS_VERSION >= 18))
/*
* Fast approximate log2
+ * It is not accurate for values very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8434,6 +8446,7 @@ extern float4 __attribute__((const, overloadable))native_normalize(float4 v);
* Fast approximate v ^ y
* v must be between 0.f and 256.f
* y must be between -15.f and 15.f
+ * It is not accurate for values of v very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8445,6 +8458,7 @@ extern float __attribute__((const, overloadable))native_powr(float v, float y);
* Fast approximate v ^ y
* v must be between 0.f and 256.f
* y must be between -15.f and 15.f
+ * It is not accurate for values of v very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8456,6 +8470,7 @@ extern float2 __attribute__((const, overloadable))native_powr(float2 v, float2 y
* Fast approximate v ^ y
* v must be between 0.f and 256.f
* y must be between -15.f and 15.f
+ * It is not accurate for values of v very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -8467,6 +8482,7 @@ extern float3 __attribute__((const, overloadable))native_powr(float3 v, float3 y
* Fast approximate v ^ y
* v must be between 0.f and 256.f
* y must be between -15.f and 15.f
+ * It is not accurate for values of v very close to zero.
*
* Supported by API versions 18 and newer.
*/
@@ -9143,7 +9159,7 @@ extern float4 __attribute__((const, overloadable))remainder(float4 x, float4 y);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the quotient and the remainder of b/c
+ * Return the quotient and the remainder of b/c. Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
*
* Supported by API versions 9 and newer.
*/
@@ -9152,7 +9168,7 @@ extern float __attribute__((overloadable))remquo(float b, float c, int* d);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the quotient and the remainder of b/c
+ * Return the quotient and the remainder of b/c. Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
*
* Supported by API versions 9 and newer.
*/
@@ -9161,7 +9177,7 @@ extern float2 __attribute__((overloadable))remquo(float2 b, float2 c, int2* d);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the quotient and the remainder of b/c
+ * Return the quotient and the remainder of b/c. Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
*
* Supported by API versions 9 and newer.
*/
@@ -9170,7 +9186,7 @@ extern float3 __attribute__((overloadable))remquo(float3 b, float3 c, int3* d);
#if (defined(RS_VERSION) && (RS_VERSION >= 9))
/*
- * Return the quotient and the remainder of b/c
+ * Return the quotient and the remainder of b/c. Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
*
* Supported by API versions 9 and newer.
*/
@@ -9653,38 +9669,38 @@ extern float3 __attribute__((const, overloadable))step(float3 edge, float v);
extern float4 __attribute__((const, overloadable))step(float4 edge, float v);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* if (v < edge)
* return 0.f;
* else
* return 1.f;
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern float2 __attribute__((const, overloadable))step(float edge, float2 v);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* if (v < edge)
* return 0.f;
* else
* return 1.f;
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern float3 __attribute__((const, overloadable))step(float edge, float3 v);
#endif
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
/*
* if (v < edge)
* return 0.f;
* else
* return 1.f;
*
- * Supported by API versions 20 and newer.
+ * Supported by API versions 21 and newer.
*/
extern float4 __attribute__((const, overloadable))step(float edge, float4 v);
#endif
diff --git a/renderscript/include/rs_matrix.rsh b/renderscript/include/rs_matrix.rsh
index ebff7f4..34b9532 100644
--- a/renderscript/include/rs_matrix.rsh
+++ b/renderscript/include/rs_matrix.rsh
@@ -15,8 +15,35 @@
*/
/** @file rs_matrix.rsh
- * \brief Matrix routines
+ * \brief Matrix functions.
*
+ * These functions let you manipulate square matrices of rank 2x2, 3x3, and 4x4.
+ * They are particularly useful for graphical transformations and are
+ * compatible with OpenGL.
+ *
+ * A few general notes:
+ *
+ * \li We use a zero-based index for rows and columns. E.g. the last element of
+ * a \ref rs_matrix4x4 is found at (3, 3).
+ *
+ * \li RenderScript uses column-based vectors. Transforming a vector is done by
+ * postmultiplying the vector, e.g. <em>(matrix * vector)</em>, as provided by
+ * \ref rsMatrixMultiply.
+ *
+ * \li To create a transformation matrix that performs two transformations at
+ * once, multiply the two source matrices, with the first transformation as the
+ * right argument. E.g. to create a transformation matrix that applies the
+ * transformation \e s1 followed by \e s2, call
+ * </c>rsMatrixLoadMultiply(&combined, &s2, &s1)</c>.
+ * This derives from <em>s2 * (s1 * v)</em>, which is <em>(s2 * s1) * v</em>.
+ *
+ * \li We have two style of functions to create transformation matrices:
+ * rsMatrixLoad<em>Transformation</em> and rsMatrix<em>Transformation</em>. The
+ * former style simply stores the transformation matrix in the first argument.
+ * The latter modifies a pre-existing transformation matrix so that the new
+ * transformation happens first. E.g. if you call \ref rsMatrixTranslate
+ * on a matrix that already does a scaling, the resulting matrix when applied
+ * to a vector will first do the translation then the scaling.
*
*/
@@ -24,54 +51,60 @@
#define __RS_MATRIX_RSH__
/**
- * Set one element of a matrix.
+ * Set an element of a matrix.
+ *
+ * @param m The matrix that will be modified.
+ * @param col The zero-based column of the element to be set.
+ * @param row The zero-based row of the element to be set.
+ * @param v The value to set.
*
- * @param m The matrix to be set
- * @param row
- * @param col
- * @param v
+ * \warning The order of the column and row parameters may be
+ * unexpected.
*
* @return void
*/
_RS_RUNTIME void __attribute__((overloadable))
-rsMatrixSet(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v);
+rsMatrixSet(rs_matrix4x4 *m, uint32_t col, uint32_t row, float v);
/**
* \overload
*/
_RS_RUNTIME void __attribute__((overloadable))
-rsMatrixSet(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v);
+rsMatrixSet(rs_matrix3x3 *m, uint32_t col, uint32_t row, float v);
/**
* \overload
*/
_RS_RUNTIME void __attribute__((overloadable))
-rsMatrixSet(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v);
+rsMatrixSet(rs_matrix2x2 *m, uint32_t col, uint32_t row, float v);
/**
- * Get one element of a matrix.
+ * Returns one element of a matrix.
+ *
+ * @param m The matrix to extract the element from.
+ * @param col The zero-based column of the element to be extracted.
+ * @param row The zero-based row of the element to extracted.
*
- * @param m The matrix to read from
- * @param row
- * @param col
+ * \warning The order of the column and row parameters may be
+ * unexpected.
*
* @return float
*/
_RS_RUNTIME float __attribute__((overloadable))
-rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col);
+rsMatrixGet(const rs_matrix4x4 *m, uint32_t col, uint32_t row);
/**
* \overload
*/
_RS_RUNTIME float __attribute__((overloadable))
-rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col);
+rsMatrixGet(const rs_matrix3x3 *m, uint32_t col, uint32_t row);
/**
* \overload
*/
_RS_RUNTIME float __attribute__((overloadable))
-rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col);
+rsMatrixGet(const rs_matrix2x2 *m, uint32_t col, uint32_t row);
/**
* Set the elements of a matrix to the identity matrix.
*
- * @param m
+ * @param m The matrix to set.
*/
extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m);
/**
@@ -86,7 +119,13 @@ extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m);
/**
* Set the elements of a matrix from an array of floats.
*
- * @param m
+ * The array of floats should be in row-major order, i.e. the element a
+ * <em>row 0, column 0</em> should be first, followed by the element at
+ * <em>row 0, column 1</em>, etc.
+ *
+ * @param m The matrix to set.
+ * @param v The array of values to set the matrix to. These arrays should be
+ * 4, 9, or 16 floats long, depending on the matrix size.
*/
extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v);
/**
@@ -98,18 +137,29 @@ extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const fl
*/
extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v);
/**
- * \overload
+ * Set the elements of a matrix from another matrix.
+ *
+ * If the source matrix is smaller than the destination, the rest of the
+ * destination is filled with elements of the identity matrix. E.g.
+ * loading a rs_matrix2x2 into a rs_matrix4x4 will give:
+ *
+ * \htmlonly<table>
+ * <tr><td>m00</td><td>m01</td><td>0.0</td><td>0.0</td></tr>
+ * <tr><td>m10</td><td>m11</td><td>0.0</td><td>0.0</td></tr>
+ * <tr><td>0.0</td><td>0.0</td><td>1.0</td><td>0.0</td></tr>
+ * <tr><td>0.0</td><td>0.0</td><td>0.0</td><td>1.0</td></tr>
+ * </table>\endhtmlonly
+ *
+ * @param m The matrix to set.
+ * @param v The source matrix.
*/
extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v);
/**
* \overload
*/
extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v);
-
/**
- * Set the elements of a matrix from another matrix.
- *
- * @param m
+ * \overload
*/
extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v);
/**
@@ -124,11 +174,19 @@ extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs
/**
* Load a rotation matrix.
*
- * @param m
- * @param rot
- * @param x
- * @param y
- * @param z
+ * This function creates a rotation matrix. The axis of rotation is the
+ * <em>(x, y, z)</em> vector.
+ *
+ * To rotate a vector, multiply the vector by the created matrix
+ * using \ref rsMatrixMultiply.
+ *
+ * See http://en.wikipedia.org/wiki/Rotation_matrix .
+ *
+ * @param m The matrix to set.
+ * @param rot How much rotation to do, in degrees.
+ * @param x The x component of the vector that is the axis of rotation.
+ * @param y The y component of the vector that is the axis of rotation.
+ * @param z The z component of the vector that is the axis of rotation.
*/
extern void __attribute__((overloadable))
rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z);
@@ -136,10 +194,16 @@ rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z);
/**
* Load a scale matrix.
*
- * @param m
- * @param x
- * @param y
- * @param z
+ * This function creates a scaling matrix, where each component of a
+ * vector is multiplied by a number. This number can be negative.
+ *
+ * To scale a vector, multiply the vector by the created matrix
+ * using \ref rsMatrixMultiply.
+ *
+ * @param m The matrix to set.
+ * @param x The multiple to scale the x components by.
+ * @param y The multiple to scale the y components by.
+ * @param z The multiple to scale the z components by.
*/
extern void __attribute__((overloadable))
rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z);
@@ -147,20 +211,38 @@ rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z);
/**
* Load a translation matrix.
*
- * @param m
- * @param x
- * @param y
- * @param z
+ * This function creates a translation matrix, where a
+ * number is added to each element of a vector.
+ *
+ * To translate a vector, multiply the vector by the created matrix
+ * using \ref rsMatrixMultiply.
+ *
+ * @param m The matrix to set.
+ * @param x The number to add to each x component.
+ * @param y The number to add to each y component.
+ * @param z The number to add to each z component.
*/
extern void __attribute__((overloadable))
rsMatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z);
/**
- * Multiply two matrix (lhs, rhs) and place the result in m.
+ * Multiply two matrices.
+ *
+ * Sets \e m to the matrix product of <em>lhs * rhs</em>.
*
- * @param m
- * @param lhs
- * @param rhs
+ * To combine two 4x4 transformaton matrices, multiply the second transformation matrix
+ * by the first transformation matrix. E.g. to create a transformation matrix that applies
+ * the transformation \e s1 followed by \e s2, call
+ * </c>rsMatrixLoadMultiply(&combined, &s2, &s1)</c>.
+ *
+ * \warning Prior to version 21, storing the result back into right matrix is not supported and
+ * will result in undefined behavior. Use rsMatrixMulitply instead. E.g. instead of doing
+ * rsMatrixLoadMultiply (&m2r, &m2r, &m2l), use rsMatrixMultiply (&m2r, &m2l).
+ * rsMatrixLoadMultiply (&m2l, &m2r, &m2l) works as expected.
+ *
+ * @param m The matrix to set.
+ * @param lhs The left matrix of the product.
+ * @param rhs The right matrix of the product.
*/
extern void __attribute__((overloadable))
rsMatrixLoadMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs);
@@ -176,10 +258,16 @@ extern void __attribute__((overloadable))
rsMatrixLoadMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs);
/**
- * Multiply the matrix m by rhs and place the result back into m.
+ * Multiply a matrix into another one.
+ *
+ * Sets \e m to the matrix product <em>m * rhs</em>.
*
- * @param m (lhs)
- * @param rhs
+ * When combining two 4x4 transformation matrices using this function, the resulting
+ * matrix will correspond to performing the \e rhs transformation first followed by
+ * the original \e m transformation.
+ *
+ * @param m The left matrix of the product and the matrix to be set.
+ * @param rhs The right matrix of the product.
*/
extern void __attribute__((overloadable))
rsMatrixMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *rhs);
@@ -195,43 +283,73 @@ extern void __attribute__((overloadable))
rsMatrixMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *rhs);
/**
- * Multiple matrix m with a rotation matrix
+ * Multiply the matrix \e m with a rotation matrix.
+ *
+ * This function modifies a transformation matrix to first do a rotation.
+ * The axis of rotation is the <em>(x, y, z)</em> vector.
*
- * @param m
- * @param rot
- * @param x
- * @param y
- * @param z
+ * To apply this combined transformation to a vector, multiply
+ * the vector by the created matrix using \ref rsMatrixMultiply.
+ *
+ * @param m The matrix to modify.
+ * @param rot How much rotation to do, in degrees.
+ * @param x The x component of the vector that is the axis of rotation.
+ * @param y The y component of the vector that is the axis of rotation.
+ * @param z The z component of the vector that is the axis of rotation.
*/
extern void __attribute__((overloadable))
rsMatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z);
/**
- * Multiple matrix m with a scale matrix
+ * Multiply the matrix \e m with a scaling matrix.
+ *
+ * This function modifies a transformation matrix to first do a scaling.
+ * When scaling, each component of a vector is multiplied by a number.
+ * This number can be negative.
*
- * @param m
- * @param x
- * @param y
- * @param z
+ * To apply this combined transformation to a vector, multiply
+ * the vector by the created matrix using \ref rsMatrixMultiply.
+ *
+ * @param m The matrix to modify.
+ * @param x The multiple to scale the x components by.
+ * @param y The multiple to scale the y components by.
+ * @param z The multiple to scale the z components by.
*/
extern void __attribute__((overloadable))
rsMatrixScale(rs_matrix4x4 *m, float x, float y, float z);
/**
- * Multiple matrix m with a translation matrix
+ * Multiply the matrix \e m with a translation matrix.
+ *
+ * This function modifies a transformation matrix to first
+ * do a translation. When translating, a number is added
+ * to each component of a vector.
+ *
+ * To apply this combined transformation to a vector, multiply
+ * the vector by the created matrix using \ref rsMatrixMultiply.
*
- * @param m
- * @param x
- * @param y
- * @param z
+ * @param m The matrix to modify.
+ * @param x The number to add to each x component.
+ * @param y The number to add to each y component.
+ * @param z The number to add to each z component.
*/
extern void __attribute__((overloadable))
rsMatrixTranslate(rs_matrix4x4 *m, float x, float y, float z);
/**
- * Load an Ortho projection matrix constructed from the 6 planes
+ * Load an orthographic projection matrix.
*
- * @param m
+ * Constructs an orthographic projection matrix, transforming the box
+ * identified by the six clipping planes <em>left, right, bottom, top,
+ * near, far</em> into a unit cube with a corner at
+ * <em>(-1, -1, -1)</em> and the opposite at <em>(1, 1, 1)</em>.
+ *
+ * To apply this projection to a vector, multiply the vector by the
+ * created matrix using \ref rsMatrixMultiply.
+ *
+ * See https://en.wikipedia.org/wiki/Orthographic_projection .
+ *
+ * @param m The matrix to set.
* @param left
* @param right
* @param bottom
@@ -243,9 +361,16 @@ extern void __attribute__((overloadable))
rsMatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far);
/**
- * Load an Frustum projection matrix constructed from the 6 planes
+ * Load a frustum projection matrix.
+ *
+ * Constructs a frustum projection matrix, transforming the box
+ * identified by the six clipping planes <em>left, right, bottom, top,
+ * near, far</em>.
*
- * @param m
+ * To apply this projection to a vector, multiply the vector by the
+ * created matrix using \ref rsMatrixMultiply.
+ *
+ * @param m The matrix to set.
* @param left
* @param right
* @param bottom
@@ -257,21 +382,36 @@ extern void __attribute__((overloadable))
rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far);
/**
- * Load an perspective projection matrix constructed from the 6 planes
+ * Load a perspective projection matrix.
+ *
+ * Constructs a perspective projection matrix, assuming a symmetrical field of view.
+ *
+ * To apply this projection to a vector, multiply the vector by the
+ * created matrix using \ref rsMatrixMultiply.
*
- * @param m
+ * @param m The matrix to set.
* @param fovy Field of view, in degrees along the Y axis.
* @param aspect Ratio of x / y.
- * @param near
- * @param far
+ * @param near The near clipping plane.
+ * @param far The far clipping plane.
*/
extern void __attribute__((overloadable))
rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far);
#if !defined(RS_VERSION) || (RS_VERSION < 14)
/**
- * Multiply a vector by a matrix and return the result vector.
- * API version 10-13
+ * Multiply a vector by a matrix.
+ *
+ * Returns the post-multiplication of the vector by the matrix, ie. <em>m * in</em>.
+ *
+ * When multiplying a \e float3 to a \e rs_matrix4x4, the vector is expanded with (1).
+ *
+ * When multiplying a \e float2 to a \e rs_matrix4x4, the vector is expanded with (0, 1).
+ *
+ * When multiplying a \e float2 to a \e rs_matrix3x3, the vector is expanded with (0).
+ *
+ * This function is available in API version 10-13. Starting with API 14,
+ * the function takes a const matrix as the first argument.
*/
_RS_RUNTIME float4 __attribute__((overloadable))
rsMatrixMultiply(rs_matrix4x4 *m, float4 in);
@@ -307,8 +447,17 @@ _RS_RUNTIME float2 __attribute__((overloadable))
rsMatrixMultiply(rs_matrix2x2 *m, float2 in);
#else
/**
- * Multiply a vector by a matrix and return the result vector.
- * API version 14+
+ * Multiply a vector by a matrix.
+ *
+ * Returns the post-multiplication of the vector of the matrix, i.e. <em>m * in</em>.
+ *
+ * When multiplying a \e float3 to a \e rs_matrix4x4, the vector is expanded with (1).
+ *
+ * When multiplying a \e float2 to a \e rs_matrix4x4, the vector is expanded with (0, 1).
+ *
+ * When multiplying a \e float2 to a \e rs_matrix3x3, the vector is expanded with (0).
+ *
+ * This function is available starting with API version 14.
*/
_RS_RUNTIME float4 __attribute__((overloadable))
rsMatrixMultiply(const rs_matrix4x4 *m, float4 in);
@@ -346,23 +495,28 @@ rsMatrixMultiply(const rs_matrix2x2 *m, float2 in);
/**
- * Returns true if the matrix was successfully inversed
+ * Inverts a matrix in place.
+ *
+ * Returns true if the matrix was successfully inverted.
*
- * @param m
+ * @param m The matrix to invert.
*/
extern bool __attribute__((overloadable)) rsMatrixInverse(rs_matrix4x4 *m);
/**
- * Returns true if the matrix was successfully inversed and transposed.
+ * Inverts and transpose a matrix in place.
+ *
+ * The matrix is first inverted then transposed.
+ * Returns true if the matrix was successfully inverted.
*
- * @param m
+ * @param m The matrix to modify.
*/
extern bool __attribute__((overloadable)) rsMatrixInverseTranspose(rs_matrix4x4 *m);
/**
- * Transpose the matrix m.
+ * Transpose the matrix m in place.
*
- * @param m
+ * @param m The matrix to transpose.
*/
extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix4x4 *m);
/**
diff --git a/renderscript/include/rs_types.rsh b/renderscript/include/rs_types.rsh
index 33cd7da..f1fc60b 100644
--- a/renderscript/include/rs_types.rsh
+++ b/renderscript/include/rs_types.rsh
@@ -72,7 +72,11 @@ typedef int int32_t;
/**
* 64 bit integer type
*/
-typedef long long int64_t;
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+ typedef long int64_t;
+#else
+ typedef long long int64_t;
+#endif
/**
* 8 bit unsigned integer type
*/
@@ -88,7 +92,11 @@ typedef unsigned int uint32_t;
/**
* 64 bit unsigned integer type
*/
-typedef unsigned long long uint64_t;
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+ typedef unsigned long uint64_t;
+#else
+ typedef unsigned long long uint64_t;
+#endif
/**
* 8 bit unsigned integer type
*/
diff --git a/renderscript/lib/arm/libclcore.bc b/renderscript/lib/arm/libclcore.bc
index 87197a6..ddb5263 100644
--- a/renderscript/lib/arm/libclcore.bc
+++ b/renderscript/lib/arm/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/mips/libclcore.bc b/renderscript/lib/mips/libclcore.bc
index 87197a6..ddb5263 100644
--- a/renderscript/lib/mips/libclcore.bc
+++ b/renderscript/lib/mips/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/x86/libclcore.bc b/renderscript/lib/x86/libclcore.bc
index b537f66..6aa69ee 100644
--- a/renderscript/lib/x86/libclcore.bc
+++ b/renderscript/lib/x86/libclcore.bc
Binary files differ