summaryrefslogtreecommitdiffstats
path: root/renderscript
diff options
context:
space:
mode:
authorJean-Luc Brouillet <jeanluc@google.com>2015-04-02 14:46:27 -0700
committerJean-Luc Brouillet <jeanluc@google.com>2015-04-02 14:46:27 -0700
commit4fbd903911a8c8fd8658f2ab7d2e1cde6a74fbf0 (patch)
tree827305e8d4c0e3bb94d3423133eeb7de35a3b1d2 /renderscript
parent99aa9032c24304e784925ca6a7244403c03841ca (diff)
downloadprebuilts_sdk-4fbd903911a8c8fd8658f2ab7d2e1cde6a74fbf0.zip
prebuilts_sdk-4fbd903911a8c8fd8658f2ab7d2e1cde6a74fbf0.tar.gz
prebuilts_sdk-4fbd903911a8c8fd8658f2ab7d2e1cde6a74fbf0.tar.bz2
Reorganize header files to improve documentation. Linux prebuilts.
Change-Id: I80e291325cac5d5749b5f1a8ba7b22688811f2d4
Diffstat (limited to 'renderscript')
-rw-r--r--renderscript/include/rs_allocation_data.rsh (renamed from renderscript/include/rs_allocation.rsh)113
-rw-r--r--renderscript/include/rs_convert.rsh1277
-rw-r--r--renderscript/include/rs_core.rsh349
-rw-r--r--renderscript/include/rs_core_math.rsh5433
-rw-r--r--renderscript/include/rs_dct.rsh14
-rw-r--r--renderscript/include/rs_fadst.rsh14
-rw-r--r--renderscript/include/rs_for_each.rsh338
-rw-r--r--renderscript/include/rs_graphics.rsh492
-rw-r--r--renderscript/include/rs_iadst.rsh14
-rw-r--r--renderscript/include/rs_idct.rsh13
-rw-r--r--renderscript/include/rs_io.rsh74
-rw-r--r--renderscript/include/rs_math.rsh4168
-rw-r--r--renderscript/include/rs_matrix.rsh104
-rw-r--r--renderscript/include/rs_mesh.rsh99
-rw-r--r--renderscript/include/rs_object.rsh173
-rw-r--r--renderscript/include/rs_object_info.rsh (renamed from renderscript/include/rs_element.rsh)207
-rw-r--r--renderscript/include/rs_object_types.rsh245
-rw-r--r--renderscript/include/rs_program.rsh147
-rw-r--r--renderscript/include/rs_sampler.rsh91
-rw-r--r--renderscript/include/rs_types.rsh879
-rw-r--r--renderscript/include/rs_value_types.rsh405
-rw-r--r--renderscript/include/rs_vector_math.rsh284
-rw-r--r--renderscript/include/rs_vp9.rsh29
-rw-r--r--renderscript/include/rs_walsh.rsh11
-rwxr-xr-xrenderscript/lib/arm/libRSSupport.sobin780936 -> 780936 bytes
-rwxr-xr-xrenderscript/lib/arm/libRSSupportIO.sobin13604 -> 13604 bytes
-rwxr-xr-xrenderscript/lib/arm/libc.sobin621304 -> 624077 bytes
-rw-r--r--renderscript/lib/arm/libclcore.bcbin237520 -> 237456 bytes
-rwxr-xr-xrenderscript/lib/arm/libm.sobin116188 -> 128476 bytes
-rwxr-xr-xrenderscript/lib/arm/librsjni.sobin39200 -> 39272 bytes
-rw-r--r--renderscript/lib/arm/librsrt_arm.bcbin237520 -> 237456 bytes
-rw-r--r--renderscript/lib/javalib.jarbin117452 -> 130805 bytes
-rwxr-xr-xrenderscript/lib/mips/libRSSupport.sobin1088316 -> 1088324 bytes
-rwxr-xr-xrenderscript/lib/mips/libRSSupportIO.sobin5312 -> 5312 bytes
-rwxr-xr-xrenderscript/lib/mips/libc.sobin1006212 -> 1005184 bytes
-rw-r--r--renderscript/lib/mips/libclcore.bcbin237520 -> 237456 bytes
-rwxr-xr-xrenderscript/lib/mips/libm.sobin214968 -> 214968 bytes
-rwxr-xr-xrenderscript/lib/mips/librsjni.sobin71900 -> 71964 bytes
-rw-r--r--renderscript/lib/mips/librsrt_mips.bcbin237520 -> 237456 bytes
-rwxr-xr-xrenderscript/lib/x86/libRSSupport.sobin1051132 -> 1051132 bytes
-rwxr-xr-xrenderscript/lib/x86/libRSSupportIO.sobin5252 -> 5252 bytes
-rwxr-xr-xrenderscript/lib/x86/libc.sobin1025167 -> 1024190 bytes
-rw-r--r--renderscript/lib/x86/libclcore.bcbin234708 -> 234644 bytes
-rwxr-xr-xrenderscript/lib/x86/libm.sobin226696 -> 226696 bytes
-rwxr-xr-xrenderscript/lib/x86/librsjni.sobin43152 -> 47320 bytes
-rw-r--r--renderscript/lib/x86/librsrt_x86.bcbin236540 -> 236476 bytes
46 files changed, 7467 insertions, 7506 deletions
diff --git a/renderscript/include/rs_allocation.rsh b/renderscript/include/rs_allocation_data.rsh
index 2cc2a82..578e73c 100644
--- a/renderscript/include/rs_allocation.rsh
+++ b/renderscript/include/rs_allocation_data.rsh
@@ -17,13 +17,15 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
/*
- * rs_allocation.rsh: Allocation routines
+ * rs_allocation_data.rsh: Allocation routines
+ *
+ * TODO Adjust documentation.
*
* Functions that can be used to query the characteristics of an allocation,
* to set and get elements of the allocation.
*/
-#ifndef RENDERSCRIPT_RS_ALLOCATION_RSH
-#define RENDERSCRIPT_RS_ALLOCATION_RSH
+#ifndef RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
+#define RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
/*
* rsAllocationCopy1DRange: Copy consecutive values between allocations
@@ -79,96 +81,6 @@ extern void __attribute__((overloadable))
#endif
/*
- * rsAllocationGetDimFaces: Presence of more than one face
- *
- * If the allocation is a cubemap, this function returns 1 if there's more than one
- * face present. In all other cases, it returns 0.
- *
- * Returns: Returns 1 if more than one face is present, 0 otherwise.
- */
-extern uint32_t __attribute__((overloadable))
- rsAllocationGetDimFaces(rs_allocation a);
-
-/*
- * rsAllocationGetDimLOD: Presence of levels of details
- *
- * Query an allocation for the presence of more than one Level Of Details. This is useful for mipmaps.
- *
- * Returns: Returns 1 if more than one LOD is present, 0 otherwise.
- */
-extern uint32_t __attribute__((overloadable))
- rsAllocationGetDimLOD(rs_allocation a);
-
-/*
- * rsAllocationGetDimX: Size of the X dimension
- *
- * Returns the size of the X dimension of the allocation.
- *
- * Returns: The X dimension of the allocation.
- */
-extern uint32_t __attribute__((overloadable))
- rsAllocationGetDimX(rs_allocation a);
-
-/*
- * rsAllocationGetDimY: Size of the Y dimension
- *
- * Returns the size of the Y dimension of the allocation.
- * If the allocation has less than two dimensions, returns 0.
- *
- * Returns: The Y dimension of the allocation.
- */
-extern uint32_t __attribute__((overloadable))
- rsAllocationGetDimY(rs_allocation a);
-
-/*
- * rsAllocationGetDimZ: Size of the Z dimension
- *
- * Returns the size of the Z dimension of the allocation.
- * If the allocation has less than three dimensions, returns 0.
- *
- * Returns: The Z dimension of the allocation.
- */
-extern uint32_t __attribute__((overloadable))
- rsAllocationGetDimZ(rs_allocation a);
-
-/*
- * Get the element object describing the allocation's layout
- *
- * Parameters:
- * a allocation to get data from
- *
- * Returns: element describing allocation layout
- */
-extern rs_element __attribute__((overloadable))
- rsAllocationGetElement(rs_allocation a);
-
-/*
- * rsAllocationIoReceive: Receive new content from the queue
- *
- * Receive a new set of contents from the queue.
- *
- * Parameters:
- * a allocation to work on
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern void __attribute__((overloadable))
- rsAllocationIoReceive(rs_allocation a);
-#endif
-
-/*
- * rsAllocationIoSend: Send new content to the queue
- *
- * Send the contents of the Allocation to the queue.
- *
- * Parameters:
- * a allocation to work on
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern void __attribute__((overloadable))
- rsAllocationIoSend(rs_allocation a);
-#endif
-
-/*
* Get a single element from an allocation.
*/
#if (defined(RS_VERSION) && (RS_VERSION >= 22))
@@ -1075,19 +987,6 @@ extern void __attribute__((overloadable))
#endif
/*
- * rsGetAllocation: Returns the Allocation for a given pointer
- *
- * Returns the Allocation for a given pointer. The pointer should point within
- * a valid allocation. The results are undefined if the pointer is not from a
- * valid allocation.
- *
- * This function is deprecated and will be removed from the SDK in a future
- * release.
- */
-extern rs_allocation __attribute__((overloadable))
- rsGetAllocation(const void* p);
-
-/*
* rsGetElementAt: Get an element
*
* Extract a single element from an allocation.
@@ -3216,4 +3115,4 @@ extern void __attribute__((overloadable))
rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z);
#endif
-#endif // RENDERSCRIPT_RS_ALLOCATION_RSH
+#endif // RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
diff --git a/renderscript/include/rs_convert.rsh b/renderscript/include/rs_convert.rsh
new file mode 100644
index 0000000..4a94be2
--- /dev/null
+++ b/renderscript/include/rs_convert.rsh
@@ -0,0 +1,1277 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_convert.rsh: Conversion functions
+ *
+ * TODO Add desc.
+ */
+#ifndef RENDERSCRIPT_RS_CONVERT_RSH
+#define RENDERSCRIPT_RS_CONVERT_RSH
+
+/*
+ * convert: Converts numerical vectors
+ *
+ * Component wise conversion from a numerical type to another.
+ *
+ * Conversions of floating point values to integer will truncate.
+ *
+ * Conversions of numbers too large to fit the destination type yield undefined results.
+ * For example, converting a float that contains 1.0e18 to a short is undefined.
+ * Use clamp() to avoid this.
+ */
+extern float2 __attribute__((const, overloadable))
+ convert_float2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(float4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(char2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(char3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(char4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(uchar2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(uchar3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(uchar4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(short2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(short3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(short4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(ushort2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(ushort3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(ushort4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(int2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(int3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(int4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(uint2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(uint3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(uint4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(float2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(float3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(float4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(char2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(char3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(char4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(uchar2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(uchar3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(uchar4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(short2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(short3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(short4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(ushort2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(ushort3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(ushort4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(int2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(int3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(int4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(uint2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(uint3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(uint4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(float2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(float3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(float4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(char2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(char3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(char4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(uchar2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(uchar3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(uchar4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(short2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(short3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(short4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(ushort2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(ushort3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(ushort4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(int2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(int3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(int4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(uint2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(uint3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(uint4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(float2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(float3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(float4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(char2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(char3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(char4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(uchar2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(uchar3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(uchar4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(short2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(short3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(short4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(ushort2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(ushort3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(ushort4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(int2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(int3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(int4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(uint2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(uint3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(uint4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(float2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(float3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(float4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(char2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(char3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(char4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(uchar2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(uchar3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(uchar4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(short2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(short3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(short4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(ushort2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(ushort3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(ushort4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(int2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(int3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(int4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(uint2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(uint3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(uint4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(float2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(float3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(float4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(char2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(char3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(char4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(uchar2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(uchar3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(uchar4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(short2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(short3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(short4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(ushort2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(ushort3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(ushort4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(int2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(int3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(int4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(uint2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(uint3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(uint4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(float2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(float3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(float4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(char2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(char3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(char4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(uchar2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(uchar3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(uchar4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(short2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(short3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(short4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(ushort2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(ushort3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(ushort4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(int2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(int3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(int4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(uint2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(uint3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(uint4 v);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(uint4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(uint4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(uint4 v);
+#endif
+
+/*
+ * Pack floating point (0-1) RGB values into a uchar4.
+ *
+ * For the float3 variant and the variant that only specifies r, g, b,
+ * the alpha component is set to 255 (1.0).
+ */
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float r, float g, float b);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float r, float g, float b, float a);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float3 color);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float4 color);
+
+/*
+ * Unpack a uchar4 color to float4. The resulting float range will be (0-1).
+ */
+extern float4 __attribute__((const))
+ rsUnpackColor8888(uchar4 c);
+
+/*
+ * Convert from YUV to RGBA.
+ */
+extern float4 __attribute__((const, overloadable))
+ rsYuvToRGBA_float4(uchar y, uchar u, uchar v);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v);
+
+#endif // RENDERSCRIPT_RS_CONVERT_RSH
diff --git a/renderscript/include/rs_core.rsh b/renderscript/include/rs_core.rsh
index c86d23e..ff65d22 100644
--- a/renderscript/include/rs_core.rsh
+++ b/renderscript/include/rs_core.rsh
@@ -38,349 +38,22 @@
#define RS_KERNEL __attribute__((kernel))
-#include "rs_types.rsh"
-#include "rs_allocation.rsh"
+#include "stdbool.h"
+
+#include "rs_value_types.rsh"
+#include "rs_object_types.rsh"
+
+#include "rs_allocation_data.rsh"
#include "rs_atomic.rsh"
-#include "rs_core_math.rsh"
+#include "rs_convert.rsh"
#include "rs_debug.rsh"
-#include "rs_element.rsh"
+#include "rs_for_each.rsh"
+#include "rs_io.rsh"
#include "rs_math.rsh"
#include "rs_matrix.rsh"
-#include "rs_object.rsh"
+#include "rs_object_info.rsh"
#include "rs_quaternion.rsh"
-#include "rs_sampler.rsh"
#include "rs_time.rsh"
-
-/*
- * rs_for_each_strategy_t: Launch order hint for rsForEach calls
- *
- * Launch order hint for rsForEach calls. This provides a hint to the system to
- * determine in which order the root function of the target is called with each
- * cell of the allocation.
- *
- * This is a hint and implementations may not obey the order.
- */
-typedef enum rs_for_each_strategy {
- RS_FOR_EACH_STRATEGY_SERIAL = 0,
- RS_FOR_EACH_STRATEGY_DONT_CARE = 1,
- RS_FOR_EACH_STRATEGY_DST_LINEAR = 2,
- RS_FOR_EACH_STRATEGY_TILE_SMALL = 3,
- RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4,
- RS_FOR_EACH_STRATEGY_TILE_LARGE = 5
-} rs_for_each_strategy_t;
-
-/*
- * rs_kernel_context: Opaque handle to RenderScript kernel invocation context
- *
- * TODO
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-typedef const struct rs_kernel_context_t * rs_kernel_context;
-#endif
-
-/*
- * rs_script_call_t: Provides extra information to a rsForEach call
- *
- * Structure to provide extra information to a rsForEach call. Primarly used to
- * restrict the call to a subset of cells in the allocation.
- */
-typedef struct rs_script_call {
- rs_for_each_strategy_t strategy;
- uint32_t xStart;
- uint32_t xEnd;
- uint32_t yStart;
- uint32_t yEnd;
- uint32_t zStart;
- uint32_t zEnd;
- uint32_t arrayStart;
- uint32_t arrayEnd;
-} rs_script_call_t;
-
-/*
- * Make a script to script call to launch work. One of the input or output is
- * required to be a valid object. The input and output must be of the same
- * dimensions.
- *
- * Parameters:
- * script The target script to call
- * input The allocation to source data from
- * output the allocation to write date into
- * usrData The user defined params to pass to the root script. May be NULL.
- * sc Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL.
- * usrDataLen The size of the userData structure. This will be used to perform a shallow copy of the data if necessary.
- */
-#if !defined(RS_VERSION) || (RS_VERSION <= 13)
-extern void __attribute__((overloadable))
- rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
- const rs_script_call_t* sc);
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 13)
-extern void __attribute__((overloadable))
- rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
-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* sc);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
-extern void __attribute__((overloadable))
- rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
- size_t usrDataLen);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
-extern void __attribute__((overloadable))
- rsForEach(rs_script script, rs_allocation input, rs_allocation output);
-#endif
-
-/*
- * Send a message back to the client. Will not block and returns true
- * if the message was sendable and false if the fifo was full.
- * A message ID is required. Data payload is optional.
- */
-extern bool __attribute__((overloadable))
- rsSendToClient(int cmdID);
-
-extern bool __attribute__((overloadable))
- rsSendToClient(int cmdID, const void* data, uint len);
-
-/*
- * Send a message back to the client, blocking until the message is queued.
- * A message ID is required. Data payload is optional.
- */
-extern void __attribute__((overloadable))
- rsSendToClientBlocking(int cmdID);
-
-extern void __attribute__((overloadable))
- rsSendToClientBlocking(int cmdID, const void* data, uint len);
-
-/*
- * rsGetArray0: Index in the Array0 dimension for the specified context
- *
- * Returns the index in the Array0 dimension of the cell being processed,
- * as specified by the supplied context.
- *
- * This context is created when a kernel is launched and updated at each
- * iteration. It contains common characteristics of the allocations being
- * iterated over and rarely used indexes, like the Array0 index.
- *
- * You can access the context by adding a rs_kernel_context argument to your
- * kernel function. E.g.
- * short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {
- * // The current index in the common x, y, z, w dimensions are accessed by
- * // adding these variables as arguments. For the more rarely used indexes
- * // to the other dimensions, extract them from the context:
- * uint32_t index_a0 = rsGetArray0(context);
- * //...
- * }
- *
- * This function returns 0 if the Array0 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetArray0(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetArray1: Index in the Array1 dimension for the specified context
- *
- * Returns the index in the Array1 dimension of the cell being processed,
- * as specified by the supplied context. See rsGetArray0() for an explanation
- * of the context.
- *
- * Returns 0 if the Array1 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetArray1(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetArray2: Index in the Array2 dimension for the specified context
- *
- * Returns the index in the Array2 dimension of the cell being processed,
- * as specified by the supplied context. See rsGetArray0() for an explanation
- * of the context.
- *
- * Returns 0 if the Array2 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetArray2(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetArray3: Index in the Array3 dimension for the specified context
- *
- * Returns the index in the Array3 dimension of the cell being processed,
- * as specified by the supplied context. See rsGetArray0() for an explanation
- * of the context.
- *
- * Returns 0 if the Array3 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetArray3(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimArray0: Size of the Array0 dimension for the specified context
- *
- * Returns the size of the Array0 dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Array0 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimArray0(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimArray1: Size of the Array1 dimension for the specified context
- *
- * Returns the size of the Array1 dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Array1 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimArray1(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimArray2: Size of the Array2 dimension for the specified context
- *
- * Returns the size of the Array2 dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Array2 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimArray2(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimArray3: Size of the Array3 dimension for the specified context
- *
- * Returns the size of the Array3 dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Array3 dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimArray3(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimHasFaces: Presence of more than one face for the specified context
- *
- * If the context refers to a cubemap, this function returns true if there's
- * more than one face present. In all other cases, it returns false.
- * See rsGetDimX() for an explanation of the context.
- *
- * rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool.
- *
- * Returns: Returns true if more than one face is present, false otherwise.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern bool __attribute__((overloadable))
- rsGetDimHasFaces(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimLod: Number of levels of detail for the specified context
- *
- * Returns the number of levels of detail for the specified context.
- * This is useful for mipmaps. See rsGetDimX() for an explanation of the context.
- * Returns 0 if Level of Detail is not used.
- *
- * rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual
- * number of levels.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimLod(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimX: Size of the X dimension for the specified context
- *
- * Returns the size of the X dimension for the specified context.
- *
- * This context is created when a kernel is launched. It contains common
- * characteristics of the allocations being iterated over by the kernel in
- * a very efficient structure. It also contains rarely used indexes.
- *
- * You can access it by adding a rs_kernel_context argument to your kernel
- * function. E.g.
- * int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {
- * uint32_t size = rsGetDimX(context); //...
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimX(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimY: Size of the Y dimension for the specified context
- *
- * Returns the size of the X dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Y dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimY(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetDimZ: Size of the Z dimension for the specified context
- *
- * Returns the size of the Z dimension for the specified context.
- * See rsGetDimX() for an explanation of the context.
- *
- * Returns 0 if the Z dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetDimZ(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetFace: Coordinate of the Face for the specified context
- *
- * Returns the face on which the cell being processed is found, as specified
- * by the supplied context. See rsGetArray0() for an explanation of the context.
- *
- * Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
- * present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern rs_allocation_cubemap_face __attribute__((overloadable))
- rsGetFace(rs_kernel_context ctxt);
-#endif
-
-/*
- * rsGetLod: Index in the Levels of Detail dimension for the specified context.
- *
- * Returns the index in the Levels of Detail dimension of the cell being
- * processed, as specified by the supplied context. See rsGetArray0() for
- * an explanation of the context.
- *
- * Returns 0 if the Levels of Detail dimension is not present.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 23))
-extern uint32_t __attribute__((overloadable))
- rsGetLod(rs_kernel_context ctxt);
-#endif
+#include "rs_vector_math.rsh"
#endif // RENDERSCRIPT_RS_CORE_RSH
diff --git a/renderscript/include/rs_core_math.rsh b/renderscript/include/rs_core_math.rsh
deleted file mode 100644
index afa3638..0000000
--- a/renderscript/include/rs_core_math.rsh
+++ /dev/null
@@ -1,5433 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_core_math.rsh: Mathematical functions
- *
- * Most mathematical functions can be applied to scalars and vectors.
- * When applied to vectors, a vector of the function applied to each entry
- * of the input is returned.
- *
- * For example:
- *
- * float3 a, b;
- * // The following call sets
- * // a.x to sin(b.x),
- * // a.y to sin(b.y), and
- * // a.z to sin(b.z).
- * a = sin(b);
- *
- *
- * A few functions like distance() and length() interpret instead the input
- * as a single vector in n-dimensional space.
- *
- * The precision of the mathematical operations is affected by the pragmas
- * rs_fp_relaxed and rs_fp_full.
- *
- * Different precision/speed tradeoffs can be achieved by using three variants
- * of common math functions. Functions with a name starting with
- * native_ may have custom hardware implementations with weaker precision,
- * half_ may perform internal computations using 16 bit floats, and
- * fast_ are n-dimensional space computations that may use 16 bit floats.
- *
- */
-#ifndef RENDERSCRIPT_RS_CORE_MATH_RSH
-#define RENDERSCRIPT_RS_CORE_MATH_RSH
-
-/*
- * abs: Absolute value of an integer
- *
- * Returns the absolute value of an integer.
- *
- * For floats, use fabs().
- */
-extern uchar __attribute__((const, overloadable))
- abs(char v);
-
-extern uchar2 __attribute__((const, overloadable))
- abs(char2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- abs(char3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- abs(char4 v);
-
-extern ushort __attribute__((const, overloadable))
- abs(short v);
-
-extern ushort2 __attribute__((const, overloadable))
- abs(short2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- abs(short3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- abs(short4 v);
-
-extern uint __attribute__((const, overloadable))
- abs(int v);
-
-extern uint2 __attribute__((const, overloadable))
- abs(int2 v);
-
-extern uint3 __attribute__((const, overloadable))
- abs(int3 v);
-
-extern uint4 __attribute__((const, overloadable))
- abs(int4 v);
-
-/*
- * acos: Inverse cosine
- *
- * Returns the inverse cosine, in radians.
- *
- * See also native_acos().
- */
-extern float __attribute__((const, overloadable))
- acos(float v);
-
-extern float2 __attribute__((const, overloadable))
- acos(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- acos(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- acos(float4 v);
-
-/*
- * acosh: Inverse hyperbolic cosine
- *
- * Returns the inverse hyperbolic cosine, in radians.
- *
- * See also native_acosh().
- */
-extern float __attribute__((const, overloadable))
- acosh(float v);
-
-extern float2 __attribute__((const, overloadable))
- acosh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- acosh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- acosh(float4 v);
-
-/*
- * acospi: Inverse cosine divided by pi
- *
- * Returns the inverse cosine in radians, divided by pi.
- *
- * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
- *
- * See also native_acospi().
- */
-extern float __attribute__((const, overloadable))
- acospi(float v);
-
-extern float2 __attribute__((const, overloadable))
- acospi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- acospi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- acospi(float4 v);
-
-/*
- * asin: Inverse sine
- *
- * Returns the inverse sine, in radians.
- *
- * See also native_asin().
- */
-extern float __attribute__((const, overloadable))
- asin(float v);
-
-extern float2 __attribute__((const, overloadable))
- asin(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- asin(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- asin(float4 v);
-
-/*
- * asinh: Inverse hyperbolic sine
- *
- * Returns the inverse hyperbolic sine, in radians.
- *
- * See also native_asinh().
- */
-extern float __attribute__((const, overloadable))
- asinh(float v);
-
-extern float2 __attribute__((const, overloadable))
- asinh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- asinh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- asinh(float4 v);
-
-/*
- * asinpi: Inverse sine divided by pi
- *
- * Returns the inverse sine in radians, divided by pi.
- *
- * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
- *
- * See also native_asinpi().
- */
-extern float __attribute__((const, overloadable))
- asinpi(float v);
-
-extern float2 __attribute__((const, overloadable))
- asinpi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- asinpi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- asinpi(float4 v);
-
-/*
- * atan: Inverse tangent
- *
- * Returns the inverse tangent, in radians.
- *
- * See also native_atan().
- */
-extern float __attribute__((const, overloadable))
- atan(float v);
-
-extern float2 __attribute__((const, overloadable))
- atan(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- atan(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- atan(float4 v);
-
-/*
- * atan2: Inverse tangent of a ratio
- *
- * Returns the inverse tangent of (numerator / denominator), in radians.
- *
- * See also native_atan2().
- *
- * Parameters:
- * numerator The numerator
- * denominator The denominator. Can be 0.
- */
-extern float __attribute__((const, overloadable))
- atan2(float numerator, float denominator);
-
-extern float2 __attribute__((const, overloadable))
- atan2(float2 numerator, float2 denominator);
-
-extern float3 __attribute__((const, overloadable))
- atan2(float3 numerator, float3 denominator);
-
-extern float4 __attribute__((const, overloadable))
- atan2(float4 numerator, float4 denominator);
-
-/*
- * atan2pi: Inverse tangent of a ratio, divided by pi
- *
- * Returns the inverse tangent of (numerator / denominator), in radians, divided by pi.
- *
- * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
- *
- * See also native_atan2pi().
- *
- * Parameters:
- * numerator The numerator
- * denominator The denominator. Can be 0.
- */
-extern float __attribute__((const, overloadable))
- atan2pi(float numerator, float denominator);
-
-extern float2 __attribute__((const, overloadable))
- atan2pi(float2 numerator, float2 denominator);
-
-extern float3 __attribute__((const, overloadable))
- atan2pi(float3 numerator, float3 denominator);
-
-extern float4 __attribute__((const, overloadable))
- atan2pi(float4 numerator, float4 denominator);
-
-/*
- * atanh: Inverse hyperbolic tangent
- *
- * Returns the inverse hyperbolic tangent, in radians.
- *
- * See also native_atanh().
- */
-extern float __attribute__((const, overloadable))
- atanh(float v);
-
-extern float2 __attribute__((const, overloadable))
- atanh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- atanh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- atanh(float4 v);
-
-/*
- * atanpi: Inverse tangent divided by pi
- *
- * Returns the inverse tangent in radians, divided by pi.
- *
- * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
- *
- * See also native_atanpi().
- */
-extern float __attribute__((const, overloadable))
- atanpi(float v);
-
-extern float2 __attribute__((const, overloadable))
- atanpi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- atanpi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- atanpi(float4 v);
-
-/*
- * cbrt: Cube root
- *
- * Returns the cube root.
- *
- * See also native_cbrt().
- */
-extern float __attribute__((const, overloadable))
- cbrt(float v);
-
-extern float2 __attribute__((const, overloadable))
- cbrt(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- cbrt(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- cbrt(float4 v);
-
-/*
- * ceil: Smallest integer not less than a value
- *
- * Returns the smallest integer not less than a value.
- *
- * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
- *
- * See also floor().
- */
-extern float __attribute__((const, overloadable))
- ceil(float v);
-
-extern float2 __attribute__((const, overloadable))
- ceil(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- ceil(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- ceil(float4 v);
-
-/*
- * clamp: Restrain a value to a range
- *
- * Clamps a value to a specified high and low bound. clamp() returns min_value
- * if value < min_value, max_value if value > max_value, otherwise value.
- *
- * There are two variants of clamp: one where the min and max are scalars applied
- * to all entries of the value, the other where the min and max are also vectors.
- *
- * If min_value is greater than max_value, the results are undefined.
- *
- * Parameters:
- * value Value to be clamped.
- * min_value Lower bound, a scalar or matching vector.
- * max_value High bound, must match the type of low.
- */
-extern float __attribute__((const, overloadable))
- clamp(float value, float min_value, float max_value);
-
-extern float2 __attribute__((const, overloadable))
- clamp(float2 value, float2 min_value, float2 max_value);
-
-extern float3 __attribute__((const, overloadable))
- clamp(float3 value, float3 min_value, float3 max_value);
-
-extern float4 __attribute__((const, overloadable))
- clamp(float4 value, float4 min_value, float4 max_value);
-
-extern float2 __attribute__((const, overloadable))
- clamp(float2 value, float min_value, float max_value);
-
-extern float3 __attribute__((const, overloadable))
- clamp(float3 value, float min_value, float max_value);
-
-extern float4 __attribute__((const, overloadable))
- clamp(float4 value, float min_value, float max_value);
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char __attribute__((const, overloadable))
- clamp(char value, char min_value, char max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char2 __attribute__((const, overloadable))
- clamp(char2 value, char2 min_value, char2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char3 __attribute__((const, overloadable))
- clamp(char3 value, char3 min_value, char3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char4 __attribute__((const, overloadable))
- clamp(char4 value, char4 min_value, char4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar __attribute__((const, overloadable))
- clamp(uchar value, uchar min_value, uchar max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar2 __attribute__((const, overloadable))
- clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar3 __attribute__((const, overloadable))
- clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar4 __attribute__((const, overloadable))
- clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short __attribute__((const, overloadable))
- clamp(short value, short min_value, short max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short2 __attribute__((const, overloadable))
- clamp(short2 value, short2 min_value, short2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short3 __attribute__((const, overloadable))
- clamp(short3 value, short3 min_value, short3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short4 __attribute__((const, overloadable))
- clamp(short4 value, short4 min_value, short4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort __attribute__((const, overloadable))
- clamp(ushort value, ushort min_value, ushort max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort2 __attribute__((const, overloadable))
- clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort3 __attribute__((const, overloadable))
- clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort4 __attribute__((const, overloadable))
- clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int __attribute__((const, overloadable))
- clamp(int value, int min_value, int max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int2 __attribute__((const, overloadable))
- clamp(int2 value, int2 min_value, int2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int3 __attribute__((const, overloadable))
- clamp(int3 value, int3 min_value, int3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int4 __attribute__((const, overloadable))
- clamp(int4 value, int4 min_value, int4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint __attribute__((const, overloadable))
- clamp(uint value, uint min_value, uint max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint2 __attribute__((const, overloadable))
- clamp(uint2 value, uint2 min_value, uint2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint3 __attribute__((const, overloadable))
- clamp(uint3 value, uint3 min_value, uint3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint4 __attribute__((const, overloadable))
- clamp(uint4 value, uint4 min_value, uint4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long __attribute__((const, overloadable))
- clamp(long value, long min_value, long max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long2 __attribute__((const, overloadable))
- clamp(long2 value, long2 min_value, long2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long3 __attribute__((const, overloadable))
- clamp(long3 value, long3 min_value, long3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long4 __attribute__((const, overloadable))
- clamp(long4 value, long4 min_value, long4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong __attribute__((const, overloadable))
- clamp(ulong value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong2 __attribute__((const, overloadable))
- clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong3 __attribute__((const, overloadable))
- clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong4 __attribute__((const, overloadable))
- clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char2 __attribute__((const, overloadable))
- clamp(char2 value, char min_value, char max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char3 __attribute__((const, overloadable))
- clamp(char3 value, char min_value, char max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern char4 __attribute__((const, overloadable))
- clamp(char4 value, char min_value, char max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar2 __attribute__((const, overloadable))
- clamp(uchar2 value, uchar min_value, uchar max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar3 __attribute__((const, overloadable))
- clamp(uchar3 value, uchar min_value, uchar max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uchar4 __attribute__((const, overloadable))
- clamp(uchar4 value, uchar min_value, uchar max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short2 __attribute__((const, overloadable))
- clamp(short2 value, short min_value, short max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short3 __attribute__((const, overloadable))
- clamp(short3 value, short min_value, short max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern short4 __attribute__((const, overloadable))
- clamp(short4 value, short min_value, short max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort2 __attribute__((const, overloadable))
- clamp(ushort2 value, ushort min_value, ushort max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort3 __attribute__((const, overloadable))
- clamp(ushort3 value, ushort min_value, ushort max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ushort4 __attribute__((const, overloadable))
- clamp(ushort4 value, ushort min_value, ushort max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int2 __attribute__((const, overloadable))
- clamp(int2 value, int min_value, int max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int3 __attribute__((const, overloadable))
- clamp(int3 value, int min_value, int max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern int4 __attribute__((const, overloadable))
- clamp(int4 value, int min_value, int max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint2 __attribute__((const, overloadable))
- clamp(uint2 value, uint min_value, uint max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint3 __attribute__((const, overloadable))
- clamp(uint3 value, uint min_value, uint max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern uint4 __attribute__((const, overloadable))
- clamp(uint4 value, uint min_value, uint max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long2 __attribute__((const, overloadable))
- clamp(long2 value, long min_value, long max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long3 __attribute__((const, overloadable))
- clamp(long3 value, long min_value, long max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern long4 __attribute__((const, overloadable))
- clamp(long4 value, long min_value, long max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong2 __attribute__((const, overloadable))
- clamp(ulong2 value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong3 __attribute__((const, overloadable))
- clamp(ulong3 value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-extern ulong4 __attribute__((const, overloadable))
- clamp(ulong4 value, ulong min_value, ulong max_value);
-#endif
-
-/*
- * clz: Number of leading 0 bits
- *
- * Returns the number of leading 0-bits in a value.
- *
- * For example, clz((char)0x03) returns 6.
- */
-extern char __attribute__((const, overloadable))
- clz(char value);
-
-extern char2 __attribute__((const, overloadable))
- clz(char2 value);
-
-extern char3 __attribute__((const, overloadable))
- clz(char3 value);
-
-extern char4 __attribute__((const, overloadable))
- clz(char4 value);
-
-extern uchar __attribute__((const, overloadable))
- clz(uchar value);
-
-extern uchar2 __attribute__((const, overloadable))
- clz(uchar2 value);
-
-extern uchar3 __attribute__((const, overloadable))
- clz(uchar3 value);
-
-extern uchar4 __attribute__((const, overloadable))
- clz(uchar4 value);
-
-extern short __attribute__((const, overloadable))
- clz(short value);
-
-extern short2 __attribute__((const, overloadable))
- clz(short2 value);
-
-extern short3 __attribute__((const, overloadable))
- clz(short3 value);
-
-extern short4 __attribute__((const, overloadable))
- clz(short4 value);
-
-extern ushort __attribute__((const, overloadable))
- clz(ushort value);
-
-extern ushort2 __attribute__((const, overloadable))
- clz(ushort2 value);
-
-extern ushort3 __attribute__((const, overloadable))
- clz(ushort3 value);
-
-extern ushort4 __attribute__((const, overloadable))
- clz(ushort4 value);
-
-extern int __attribute__((const, overloadable))
- clz(int value);
-
-extern int2 __attribute__((const, overloadable))
- clz(int2 value);
-
-extern int3 __attribute__((const, overloadable))
- clz(int3 value);
-
-extern int4 __attribute__((const, overloadable))
- clz(int4 value);
-
-extern uint __attribute__((const, overloadable))
- clz(uint value);
-
-extern uint2 __attribute__((const, overloadable))
- clz(uint2 value);
-
-extern uint3 __attribute__((const, overloadable))
- clz(uint3 value);
-
-extern uint4 __attribute__((const, overloadable))
- clz(uint4 value);
-
-/*
- * convert: Converts numerical vectors
- *
- * Component wise conversion from a numerical type to another.
- *
- * Conversions of floating point values to integer will truncate.
- *
- * Conversions of numbers too large to fit the destination type yield undefined results.
- * For example, converting a float that contains 1.0e18 to a short is undefined.
- * Use clamp() to avoid this.
- */
-extern float2 __attribute__((const, overloadable))
- convert_float2(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(float4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(char2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(char3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(char4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(uchar2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(uchar3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(uchar4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(short2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(short3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(short4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(ushort2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(ushort3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(ushort4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(int2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(int3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(int4 v);
-
-extern float2 __attribute__((const, overloadable))
- convert_float2(uint2 v);
-
-extern float3 __attribute__((const, overloadable))
- convert_float3(uint3 v);
-
-extern float4 __attribute__((const, overloadable))
- convert_float4(uint4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(float2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(float3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(float4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(char2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(char3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(char4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(uchar2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(uchar3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(uchar4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(short2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(short3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(short4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(ushort2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(ushort3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(ushort4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(int2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(int3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(int4 v);
-
-extern char2 __attribute__((const, overloadable))
- convert_char2(uint2 v);
-
-extern char3 __attribute__((const, overloadable))
- convert_char3(uint3 v);
-
-extern char4 __attribute__((const, overloadable))
- convert_char4(uint4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(float2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(float3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(float4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(char2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(char3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(char4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(uchar2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(uchar3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(uchar4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(short2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(short3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(short4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(ushort2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(ushort3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(ushort4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(int2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(int3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(int4 v);
-
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(uint2 v);
-
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(uint3 v);
-
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(uint4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(float2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(float3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(float4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(char2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(char3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(char4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(uchar2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(uchar3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(uchar4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(short2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(short3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(short4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(ushort2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(ushort3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(ushort4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(int2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(int3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(int4 v);
-
-extern short2 __attribute__((const, overloadable))
- convert_short2(uint2 v);
-
-extern short3 __attribute__((const, overloadable))
- convert_short3(uint3 v);
-
-extern short4 __attribute__((const, overloadable))
- convert_short4(uint4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(float2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(float3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(float4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(char2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(char3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(char4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(uchar2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(uchar3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(uchar4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(short2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(short3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(short4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(ushort2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(ushort3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(ushort4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(int2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(int3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(int4 v);
-
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(uint2 v);
-
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(uint3 v);
-
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(uint4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(float2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(float3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(float4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(char2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(char3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(char4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(uchar2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(uchar3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(uchar4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(short2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(short3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(short4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(ushort2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(ushort3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(ushort4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(int2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(int3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(int4 v);
-
-extern int2 __attribute__((const, overloadable))
- convert_int2(uint2 v);
-
-extern int3 __attribute__((const, overloadable))
- convert_int3(uint3 v);
-
-extern int4 __attribute__((const, overloadable))
- convert_int4(uint4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(float2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(float3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(float4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(char2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(char3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(char4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(uchar2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(uchar3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(uchar4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(short2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(short3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(short4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(ushort2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(ushort3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(ushort4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(int2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(int3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(int4 v);
-
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(uint2 v);
-
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(uint3 v);
-
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(uint4 v);
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- convert_float2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- convert_float3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- convert_float4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- convert_float2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- convert_float3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- convert_float4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- convert_float2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- convert_float3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- convert_float4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char2 __attribute__((const, overloadable))
- convert_char2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char3 __attribute__((const, overloadable))
- convert_char3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char4 __attribute__((const, overloadable))
- convert_char4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char2 __attribute__((const, overloadable))
- convert_char2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char3 __attribute__((const, overloadable))
- convert_char3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char4 __attribute__((const, overloadable))
- convert_char4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char2 __attribute__((const, overloadable))
- convert_char2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char3 __attribute__((const, overloadable))
- convert_char3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char4 __attribute__((const, overloadable))
- convert_char4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar2 __attribute__((const, overloadable))
- convert_uchar2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar3 __attribute__((const, overloadable))
- convert_uchar3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar4 __attribute__((const, overloadable))
- convert_uchar4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short2 __attribute__((const, overloadable))
- convert_short2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short3 __attribute__((const, overloadable))
- convert_short3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short4 __attribute__((const, overloadable))
- convert_short4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short2 __attribute__((const, overloadable))
- convert_short2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short3 __attribute__((const, overloadable))
- convert_short3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short4 __attribute__((const, overloadable))
- convert_short4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short2 __attribute__((const, overloadable))
- convert_short2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short3 __attribute__((const, overloadable))
- convert_short3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short4 __attribute__((const, overloadable))
- convert_short4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort2 __attribute__((const, overloadable))
- convert_ushort2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort3 __attribute__((const, overloadable))
- convert_ushort3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort4 __attribute__((const, overloadable))
- convert_ushort4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int2 __attribute__((const, overloadable))
- convert_int2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int3 __attribute__((const, overloadable))
- convert_int3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int4 __attribute__((const, overloadable))
- convert_int4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int2 __attribute__((const, overloadable))
- convert_int2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int3 __attribute__((const, overloadable))
- convert_int3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int4 __attribute__((const, overloadable))
- convert_int4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int2 __attribute__((const, overloadable))
- convert_int2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int3 __attribute__((const, overloadable))
- convert_int3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int4 __attribute__((const, overloadable))
- convert_int4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(double2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(double3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(double4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(long2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(long3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(long4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint2 __attribute__((const, overloadable))
- convert_uint2(ulong2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint3 __attribute__((const, overloadable))
- convert_uint3(ulong3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint4 __attribute__((const, overloadable))
- convert_uint4(ulong4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(char2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(char3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(char4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(uchar2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(uchar3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(uchar4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(short2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(short3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(short4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(ushort2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(ushort3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(ushort4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(int2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(int3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(int4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double2 __attribute__((const, overloadable))
- convert_double2(uint2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double3 __attribute__((const, overloadable))
- convert_double3(uint3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern double4 __attribute__((const, overloadable))
- convert_double4(uint4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(char2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(char3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(char4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(uchar2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(uchar3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(uchar4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(short2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(short3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(short4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(ushort2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(ushort3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(ushort4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(int2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(int3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(int4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- convert_long2(uint2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- convert_long3(uint3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- convert_long4(uint4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(char2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(char3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(char4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(uchar2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(uchar3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(uchar4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(short2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(short3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(short4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(ushort2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(ushort3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(ushort4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(int2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(int3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(int4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- convert_ulong2(uint2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- convert_ulong3(uint3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- convert_ulong4(uint4 v);
-#endif
-
-/*
- * copysign: Copies the sign of a number to another
- *
- * Copies the sign from sign_value to magnitude_value.
- *
- * The value returned is either magnitude_value or -magnitude_value.
- *
- * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
- */
-extern float __attribute__((const, overloadable))
- copysign(float magnitude_value, float sign_value);
-
-extern float2 __attribute__((const, overloadable))
- copysign(float2 magnitude_value, float2 sign_value);
-
-extern float3 __attribute__((const, overloadable))
- copysign(float3 magnitude_value, float3 sign_value);
-
-extern float4 __attribute__((const, overloadable))
- copysign(float4 magnitude_value, float4 sign_value);
-
-/*
- * cos: Cosine
- *
- * Returns the cosine of an angle measured in radians.
- *
- * See also native_cos().
- */
-extern float __attribute__((const, overloadable))
- cos(float v);
-
-extern float2 __attribute__((const, overloadable))
- cos(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- cos(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- cos(float4 v);
-
-/*
- * cosh: Hypebolic cosine
- *
- * Returns the hypebolic cosine of v, where v is measured in radians.
- *
- * See also native_cosh().
- */
-extern float __attribute__((const, overloadable))
- cosh(float v);
-
-extern float2 __attribute__((const, overloadable))
- cosh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- cosh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- cosh(float4 v);
-
-/*
- * cospi: Cosine of a number multiplied by pi
- *
- * Returns the cosine of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
- *
- * See also native_cospi().
- */
-extern float __attribute__((const, overloadable))
- cospi(float v);
-
-extern float2 __attribute__((const, overloadable))
- cospi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- cospi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- cospi(float4 v);
-
-/*
- * cross: Cross product of two vectors
- *
- * Computes the cross product of two vectors.
- */
-extern float3 __attribute__((const, overloadable))
- cross(float3 left_vector, float3 right_vector);
-
-extern float4 __attribute__((const, overloadable))
- cross(float4 left_vector, float4 right_vector);
-
-/*
- * degrees: Converts radians into degrees
- *
- * Converts from radians to degrees.
- */
-extern float __attribute__((const, overloadable))
- degrees(float v);
-
-extern float2 __attribute__((const, overloadable))
- degrees(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- degrees(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- degrees(float4 v);
-
-/*
- * distance: Distance between two points
- *
- * Compute the distance between two points.
- *
- * See also fast_distance(), native_distance().
- */
-extern float __attribute__((const, overloadable))
- distance(float left_vector, float right_vector);
-
-extern float __attribute__((const, overloadable))
- distance(float2 left_vector, float2 right_vector);
-
-extern float __attribute__((const, overloadable))
- distance(float3 left_vector, float3 right_vector);
-
-extern float __attribute__((const, overloadable))
- distance(float4 left_vector, float4 right_vector);
-
-/*
- * dot: Dot product of two vectors
- *
- * Computes the dot product of two vectors.
- */
-extern float __attribute__((const, overloadable))
- dot(float left_vector, float right_vector);
-
-extern float __attribute__((const, overloadable))
- dot(float2 left_vector, float2 right_vector);
-
-extern float __attribute__((const, overloadable))
- dot(float3 left_vector, float3 right_vector);
-
-extern float __attribute__((const, overloadable))
- dot(float4 left_vector, float4 right_vector);
-
-/*
- * erf: Mathematical error function
- *
- * Returns the error function.
- */
-extern float __attribute__((const, overloadable))
- erf(float v);
-
-extern float2 __attribute__((const, overloadable))
- erf(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- erf(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- erf(float4 v);
-
-/*
- * erfc: Mathematical complementary error function
- *
- * Returns the complementary error function.
- */
-extern float __attribute__((const, overloadable))
- erfc(float v);
-
-extern float2 __attribute__((const, overloadable))
- erfc(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- erfc(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- erfc(float4 v);
-
-/*
- * exp: e raised to a number
- *
- * Returns e raised to v, i.e. e ^ v.
- *
- * See also native_exp().
- */
-extern float __attribute__((const, overloadable))
- exp(float v);
-
-extern float2 __attribute__((const, overloadable))
- exp(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- exp(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- exp(float4 v);
-
-/*
- * exp10: 10 raised to a number
- *
- * Returns 10 raised to v, i.e. 10.f ^ v.
- *
- * See also native_exp10().
- */
-extern float __attribute__((const, overloadable))
- exp10(float v);
-
-extern float2 __attribute__((const, overloadable))
- exp10(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- exp10(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- exp10(float4 v);
-
-/*
- * exp2: 2 raised to a number
- *
- * Returns 2 raised to v, i.e. 2.f ^ v.
- *
- * See also native_exp2().
- */
-extern float __attribute__((const, overloadable))
- exp2(float v);
-
-extern float2 __attribute__((const, overloadable))
- exp2(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- exp2(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- exp2(float4 v);
-
-/*
- * expm1: e raised to a number minus one
- *
- * Returns e raised to v minus 1, i.e. (e ^ v) - 1.
- *
- * See also native_expm1().
- */
-extern float __attribute__((const, overloadable))
- expm1(float v);
-
-extern float2 __attribute__((const, overloadable))
- expm1(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- expm1(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- expm1(float4 v);
-
-/*
- * fabs: Absolute value of a float
- *
- * Returns the absolute value of the float v.
- *
- * For integers, use abs().
- */
-extern float __attribute__((const, overloadable))
- fabs(float v);
-
-extern float2 __attribute__((const, overloadable))
- fabs(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- fabs(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- fabs(float4 v);
-
-/*
- * fast_distance: Approximate distance between two points
- *
- * Computes the approximate distance between two points.
- *
- * The precision is what would be expected from doing the computation using 16 bit floating point values.
- *
- * See also distance(), native_distance().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_distance(float left_vector, float right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_distance(float2 left_vector, float2 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_distance(float3 left_vector, float3 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_distance(float4 left_vector, float4 right_vector);
-#endif
-
-/*
- * fast_length: Approximate length of a vector
- *
- * Computes the approximate length of a vector.
- *
- * The precision is what would be expected from doing the computation using 16 bit floating point values.
- *
- * See also length(), native_length().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_length(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_length(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_length(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_length(float4 v);
-#endif
-
-/*
- * fast_normalize: Approximate normalized vector
- *
- * Approximately normalizes a vector.
- *
- * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
- *
- * The precision is what would be expected from doing the computation using 16 bit floating point values.
- *
- * See also normalize(), native_normalize().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- fast_normalize(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float2 __attribute__((const, overloadable))
- fast_normalize(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float3 __attribute__((const, overloadable))
- fast_normalize(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float4 __attribute__((const, overloadable))
- fast_normalize(float4 v);
-#endif
-
-/*
- * fdim: Positive difference between two values
- *
- * Returns the positive difference between two values.
- *
- * If a > b, returns (a - b) otherwise returns 0f.
- */
-extern float __attribute__((const, overloadable))
- fdim(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- fdim(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- fdim(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- fdim(float4 a, float4 b);
-
-/*
- * floor: Smallest integer not greater than a value
- *
- * Returns the smallest integer not greater than a value.
- *
- * For example, floor(1.2f) returns 1.f, and floor(-1.2f) returns -2.f.
- *
- * See also ceil().
- */
-extern float __attribute__((const, overloadable))
- floor(float v);
-
-extern float2 __attribute__((const, overloadable))
- floor(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- floor(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- floor(float4 v);
-
-/*
- * fma: Multiply and add
- *
- * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
- *
- * This function is similar to mad(). fma() retains full precision of the
- * multiplied result and rounds only after the addition. mad() rounds after the
- * multiplication and the addition. This extra precision is not guaranteed in
- * rs_fp_relaxed mode.
- */
-extern float __attribute__((const, overloadable))
- fma(float multiplicand1, float multiplicand2, float offset);
-
-extern float2 __attribute__((const, overloadable))
- fma(float2 multiplicand1, float2 multiplicand2, float2 offset);
-
-extern float3 __attribute__((const, overloadable))
- fma(float3 multiplicand1, float3 multiplicand2, float3 offset);
-
-extern float4 __attribute__((const, overloadable))
- fma(float4 multiplicand1, float4 multiplicand2, float4 offset);
-
-/*
- * fmax: Maximum of two floats
- *
- * Returns the maximum of a and b, i.e. (a < b ? b : a).
- *
- * The max() function returns identical results but can be applied to more data types.
- */
-extern float __attribute__((const, overloadable))
- fmax(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- fmax(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- fmax(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- fmax(float4 a, float4 b);
-
-extern float2 __attribute__((const, overloadable))
- fmax(float2 a, float b);
-
-extern float3 __attribute__((const, overloadable))
- fmax(float3 a, float b);
-
-extern float4 __attribute__((const, overloadable))
- fmax(float4 a, float b);
-
-/*
- * fmin: Minimum of two floats
- *
- * Returns the minimum of a and b, i.e. (a > b ? b : a).
- *
- * The min() function returns identical results but can be applied to more data types.
- */
-extern float __attribute__((const, overloadable))
- fmin(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- fmin(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- fmin(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- fmin(float4 a, float4 b);
-
-extern float2 __attribute__((const, overloadable))
- fmin(float2 a, float b);
-
-extern float3 __attribute__((const, overloadable))
- fmin(float3 a, float b);
-
-extern float4 __attribute__((const, overloadable))
- fmin(float4 a, float b);
-
-/*
- * fmod: Modulo
- *
- * Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
- *
- * The function remainder() is similar but rounds toward the closest interger.
- * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
- * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
- */
-extern float __attribute__((const, overloadable))
- fmod(float numerator, float denominator);
-
-extern float2 __attribute__((const, overloadable))
- fmod(float2 numerator, float2 denominator);
-
-extern float3 __attribute__((const, overloadable))
- fmod(float3 numerator, float3 denominator);
-
-extern float4 __attribute__((const, overloadable))
- fmod(float4 numerator, float4 denominator);
-
-/*
- * fract: Positive fractional part
- *
- * Returns the positive fractional part of v, i.e. v - floor(v).
- *
- * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
- * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
- *
- * Parameters:
- * v Input value.
- * floor If floor is not null, *floor will be set to the floor of v.
- */
-extern float __attribute__((overloadable))
- fract(float v, float* floor);
-
-extern float2 __attribute__((overloadable))
- fract(float2 v, float2* floor);
-
-extern float3 __attribute__((overloadable))
- fract(float3 v, float3* floor);
-
-extern float4 __attribute__((overloadable))
- fract(float4 v, float4* floor);
-
-static inline float __attribute__((const, overloadable))
- fract(float v) {
- float unused;
- return fract(v, &unused);
-}
-
-static inline float2 __attribute__((const, overloadable))
- fract(float2 v) {
- float2 unused;
- return fract(v, &unused);
-}
-
-static inline float3 __attribute__((const, overloadable))
- fract(float3 v) {
- float3 unused;
- return fract(v, &unused);
-}
-
-static inline float4 __attribute__((const, overloadable))
- fract(float4 v) {
- float4 unused;
- return fract(v, &unused);
-}
-
-/*
- * frexp: Binary mantissa and exponent
- *
- * Returns the binary mantissa and exponent of v, i.e. v == mantissa * 2 ^ exponent.
- *
- * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
- *
- * See ldexp() for the reverse operation. See also logb() and ilogb().
- *
- * Parameters:
- * v Input value.
- * exponent If exponent is not null, *exponent will be set to the exponent of v.
- */
-extern float __attribute__((overloadable))
- frexp(float v, int* exponent);
-
-extern float2 __attribute__((overloadable))
- frexp(float2 v, int2* exponent);
-
-extern float3 __attribute__((overloadable))
- frexp(float3 v, int3* exponent);
-
-extern float4 __attribute__((overloadable))
- frexp(float4 v, int4* exponent);
-
-/*
- * half_recip: Reciprocal computed to 16 bit precision
- *
- * Returns the approximate reciprocal of a value.
- *
- * The precision is that of a 16 bit floating point value.
- *
- * See also native_recip().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- half_recip(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float2 __attribute__((const, overloadable))
- half_recip(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float3 __attribute__((const, overloadable))
- half_recip(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float4 __attribute__((const, overloadable))
- half_recip(float4 v);
-#endif
-
-/*
- * half_rsqrt: Reciprocal of a square root computed to 16 bit precision
- *
- * Returns the approximate value of (1.f / sqrt(value)).
- *
- * The precision is that of a 16 bit floating point value.
- *
- * See also rsqrt(), native_rsqrt().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- half_rsqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float2 __attribute__((const, overloadable))
- half_rsqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float3 __attribute__((const, overloadable))
- half_rsqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float4 __attribute__((const, overloadable))
- half_rsqrt(float4 v);
-#endif
-
-/*
- * half_sqrt: Square root computed to 16 bit precision
- *
- * Returns the approximate square root of a value.
- *
- * The precision is that of a 16 bit floating point value.
- *
- * See also sqrt(), native_sqrt().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float __attribute__((const, overloadable))
- half_sqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float2 __attribute__((const, overloadable))
- half_sqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float3 __attribute__((const, overloadable))
- half_sqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-extern float4 __attribute__((const, overloadable))
- half_sqrt(float4 v);
-#endif
-
-/*
- * hypot: Hypotenuse
- *
- * Returns the hypotenuse, i.e. sqrt(a * a + b * b).
- *
- * See also native_hypot().
- */
-extern float __attribute__((const, overloadable))
- hypot(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- hypot(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- hypot(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- hypot(float4 a, float4 b);
-
-/*
- * ilogb: Base two exponent
- *
- * Returns the base two exponent of a value, where the mantissa is between
- * 1.f (inclusive) and 2.f (exclusive).
- *
- * For example, ilogb(8.5f) returns 3.
- *
- * Because of the difference in mantissa, this number is one less than
- * is returned by frexp().
- *
- * logb() is similar but returns a float.
- */
-extern int __attribute__((const, overloadable))
- ilogb(float v);
-
-extern int2 __attribute__((const, overloadable))
- ilogb(float2 v);
-
-extern int3 __attribute__((const, overloadable))
- ilogb(float3 v);
-
-extern int4 __attribute__((const, overloadable))
- ilogb(float4 v);
-
-/*
- * ldexp: Creates a floating point from mantissa and exponent
- *
- * Returns the floating point created from the mantissa and exponent,
- * i.e. (mantissa * 2 ^ exponent).
- *
- * See frexp() for the reverse operation.
- *
- * Parameters:
- * mantissa The mantissa
- * exponent The exponent, a single component or matching vector.
- */
-extern float __attribute__((const, overloadable))
- ldexp(float mantissa, int exponent);
-
-extern float2 __attribute__((const, overloadable))
- ldexp(float2 mantissa, int2 exponent);
-
-extern float3 __attribute__((const, overloadable))
- ldexp(float3 mantissa, int3 exponent);
-
-extern float4 __attribute__((const, overloadable))
- ldexp(float4 mantissa, int4 exponent);
-
-extern float2 __attribute__((const, overloadable))
- ldexp(float2 mantissa, int exponent);
-
-extern float3 __attribute__((const, overloadable))
- ldexp(float3 mantissa, int exponent);
-
-extern float4 __attribute__((const, overloadable))
- ldexp(float4 mantissa, int exponent);
-
-/*
- * length: Length of a vector
- *
- * Computes the length of a vector.
- *
- * See also fast_length(), native_length().
- */
-extern float __attribute__((const, overloadable))
- length(float v);
-
-extern float __attribute__((const, overloadable))
- length(float2 v);
-
-extern float __attribute__((const, overloadable))
- length(float3 v);
-
-extern float __attribute__((const, overloadable))
- length(float4 v);
-
-/*
- * lgamma: Natural logarithm of the gamma function
- *
- * Returns the natural logarithm of the absolute value of the gamma function,
- * i.e. log(fabs(tgamma(v))).
- *
- * See also tgamma().
- *
- * Parameters:
- * sign_of_gamma If sign_of_gamma is not null, *sign_of_gamma will be set to -1.f if the gamma of v is negative, otherwise to 1.f.
- */
-extern float __attribute__((const, overloadable))
- lgamma(float v);
-
-extern float2 __attribute__((const, overloadable))
- lgamma(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- lgamma(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- lgamma(float4 v);
-
-extern float __attribute__((overloadable))
- lgamma(float v, int* sign_of_gamma);
-
-extern float2 __attribute__((overloadable))
- lgamma(float2 v, int2* sign_of_gamma);
-
-extern float3 __attribute__((overloadable))
- lgamma(float3 v, int3* sign_of_gamma);
-
-extern float4 __attribute__((overloadable))
- lgamma(float4 v, int4* sign_of_gamma);
-
-/*
- * log: Natural logarithm
- *
- * Returns the natural logarithm.
- *
- * See also native_log().
- */
-extern float __attribute__((const, overloadable))
- log(float v);
-
-extern float2 __attribute__((const, overloadable))
- log(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- log(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- log(float4 v);
-
-/*
- * log10: Base 10 logarithm
- *
- * Returns the base 10 logarithm.
- *
- * See also native_log10().
- */
-extern float __attribute__((const, overloadable))
- log10(float v);
-
-extern float2 __attribute__((const, overloadable))
- log10(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- log10(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- log10(float4 v);
-
-/*
- * log1p: Natural logarithm of a value plus 1
- *
- * Returns the natural logarithm of (v + 1.f).
- *
- * See also native_log1p().
- */
-extern float __attribute__((const, overloadable))
- log1p(float v);
-
-extern float2 __attribute__((const, overloadable))
- log1p(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- log1p(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- log1p(float4 v);
-
-/*
- * log2: Base 2 logarithm
- *
- * Returns the base 2 logarithm.
- *
- * See also native_log2().
- */
-extern float __attribute__((const, overloadable))
- log2(float v);
-
-extern float2 __attribute__((const, overloadable))
- log2(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- log2(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- log2(float4 v);
-
-/*
- * logb: Base two exponent
- *
- * Returns the base two exponent of a value, where the mantissa is between
- * 1.f (inclusive) and 2.f (exclusive).
- *
- * For example, logb(8.5f) returns 3.f.
- *
- * Because of the difference in mantissa, this number is one less than
- * is returned by frexp().
- *
- * ilogb() is similar but returns an integer.
- */
-extern float __attribute__((const, overloadable))
- logb(float v);
-
-extern float2 __attribute__((const, overloadable))
- logb(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- logb(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- logb(float4 v);
-
-/*
- * mad: Multiply and add
- *
- * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
- *
- * This function is similar to fma(). fma() retains full precision of the
- * multiplied result and rounds only after the addition. mad() rounds after the
- * multiplication and the addition. In rs_fp_relaxed mode, mad() may not do the
- * rounding after multiplicaiton.
- */
-extern float __attribute__((const, overloadable))
- mad(float multiplicand1, float multiplicand2, float offset);
-
-extern float2 __attribute__((const, overloadable))
- mad(float2 multiplicand1, float2 multiplicand2, float2 offset);
-
-extern float3 __attribute__((const, overloadable))
- mad(float3 multiplicand1, float3 multiplicand2, float3 offset);
-
-extern float4 __attribute__((const, overloadable))
- mad(float4 multiplicand1, float4 multiplicand2, float4 offset);
-
-/*
- * max: Maximum
- *
- * Returns the maximum value of two arguments.
- */
-extern float __attribute__((const, overloadable))
- max(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- max(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- max(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- max(float4 a, float4 b);
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char __attribute__((const, overloadable))
- max(char a, char b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar __attribute__((const, overloadable))
- max(uchar a, uchar b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short __attribute__((const, overloadable))
- max(short a, short b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort __attribute__((const, overloadable))
- max(ushort a, ushort b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int __attribute__((const, overloadable))
- max(int a, int b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint __attribute__((const, overloadable))
- max(uint a, uint b) {
- return (a > b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char2 __attribute__((const, overloadable))
- max(char2 a, char2 b) {
- char2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar2 __attribute__((const, overloadable))
- max(uchar2 a, uchar2 b) {
- uchar2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short2 __attribute__((const, overloadable))
- max(short2 a, short2 b) {
- short2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort2 __attribute__((const, overloadable))
- max(ushort2 a, ushort2 b) {
- ushort2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int2 __attribute__((const, overloadable))
- max(int2 a, int2 b) {
- int2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint2 __attribute__((const, overloadable))
- max(uint2 a, uint2 b) {
- uint2 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char3 __attribute__((const, overloadable))
- max(char3 a, char3 b) {
- char3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar3 __attribute__((const, overloadable))
- max(uchar3 a, uchar3 b) {
- uchar3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short3 __attribute__((const, overloadable))
- max(short3 a, short3 b) {
- short3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort3 __attribute__((const, overloadable))
- max(ushort3 a, ushort3 b) {
- ushort3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int3 __attribute__((const, overloadable))
- max(int3 a, int3 b) {
- int3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint3 __attribute__((const, overloadable))
- max(uint3 a, uint3 b) {
- uint3 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char4 __attribute__((const, overloadable))
- max(char4 a, char4 b) {
- char4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar4 __attribute__((const, overloadable))
- max(uchar4 a, uchar4 b) {
- uchar4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short4 __attribute__((const, overloadable))
- max(short4 a, short4 b) {
- short4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort4 __attribute__((const, overloadable))
- max(ushort4 a, ushort4 b) {
- ushort4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int4 __attribute__((const, overloadable))
- max(int4 a, int4 b) {
- int4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint4 __attribute__((const, overloadable))
- max(uint4 a, uint4 b) {
- uint4 tmp;
- tmp.x = (a.x > b.x ? a.x : b.x);
- tmp.y = (a.y > b.y ? a.y : b.y);
- tmp.z = (a.z > b.z ? a.z : b.z);
- tmp.w = (a.w > b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char __attribute__((const, overloadable))
- max(char a, char b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char2 __attribute__((const, overloadable))
- max(char2 a, char2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char3 __attribute__((const, overloadable))
- max(char3 a, char3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char4 __attribute__((const, overloadable))
- max(char4 a, char4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar __attribute__((const, overloadable))
- max(uchar a, uchar b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar2 __attribute__((const, overloadable))
- max(uchar2 a, uchar2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar3 __attribute__((const, overloadable))
- max(uchar3 a, uchar3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar4 __attribute__((const, overloadable))
- max(uchar4 a, uchar4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short __attribute__((const, overloadable))
- max(short a, short b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short2 __attribute__((const, overloadable))
- max(short2 a, short2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short3 __attribute__((const, overloadable))
- max(short3 a, short3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short4 __attribute__((const, overloadable))
- max(short4 a, short4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort __attribute__((const, overloadable))
- max(ushort a, ushort b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort2 __attribute__((const, overloadable))
- max(ushort2 a, ushort2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort3 __attribute__((const, overloadable))
- max(ushort3 a, ushort3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort4 __attribute__((const, overloadable))
- max(ushort4 a, ushort4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int __attribute__((const, overloadable))
- max(int a, int b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int2 __attribute__((const, overloadable))
- max(int2 a, int2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int3 __attribute__((const, overloadable))
- max(int3 a, int3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int4 __attribute__((const, overloadable))
- max(int4 a, int4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint __attribute__((const, overloadable))
- max(uint a, uint b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint2 __attribute__((const, overloadable))
- max(uint2 a, uint2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint3 __attribute__((const, overloadable))
- max(uint3 a, uint3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint4 __attribute__((const, overloadable))
- max(uint4 a, uint4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long __attribute__((const, overloadable))
- max(long a, long b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- max(long2 a, long2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- max(long3 a, long3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- max(long4 a, long4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong __attribute__((const, overloadable))
- max(ulong a, ulong b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- max(ulong2 a, ulong2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- max(ulong3 a, ulong3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- max(ulong4 a, ulong4 b);
-#endif
-
-/*
- * min: Minimum
- *
- * Returns the minimum value of two arguments.
- */
-extern float __attribute__((const, overloadable))
- min(float a, float b);
-
-extern float2 __attribute__((const, overloadable))
- min(float2 a, float2 b);
-
-extern float3 __attribute__((const, overloadable))
- min(float3 a, float3 b);
-
-extern float4 __attribute__((const, overloadable))
- min(float4 a, float4 b);
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char __attribute__((const, overloadable))
- min(char a, char b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar __attribute__((const, overloadable))
- min(uchar a, uchar b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short __attribute__((const, overloadable))
- min(short a, short b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort __attribute__((const, overloadable))
- min(ushort a, ushort b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int __attribute__((const, overloadable))
- min(int a, int b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint __attribute__((const, overloadable))
- min(uint a, uint b) {
- return (a < b ? a : b);
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char2 __attribute__((const, overloadable))
- min(char2 a, char2 b) {
- char2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar2 __attribute__((const, overloadable))
- min(uchar2 a, uchar2 b) {
- uchar2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short2 __attribute__((const, overloadable))
- min(short2 a, short2 b) {
- short2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort2 __attribute__((const, overloadable))
- min(ushort2 a, ushort2 b) {
- ushort2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int2 __attribute__((const, overloadable))
- min(int2 a, int2 b) {
- int2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint2 __attribute__((const, overloadable))
- min(uint2 a, uint2 b) {
- uint2 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char3 __attribute__((const, overloadable))
- min(char3 a, char3 b) {
- char3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar3 __attribute__((const, overloadable))
- min(uchar3 a, uchar3 b) {
- uchar3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short3 __attribute__((const, overloadable))
- min(short3 a, short3 b) {
- short3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort3 __attribute__((const, overloadable))
- min(ushort3 a, ushort3 b) {
- ushort3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int3 __attribute__((const, overloadable))
- min(int3 a, int3 b) {
- int3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint3 __attribute__((const, overloadable))
- min(uint3 a, uint3 b) {
- uint3 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline char4 __attribute__((const, overloadable))
- min(char4 a, char4 b) {
- char4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uchar4 __attribute__((const, overloadable))
- min(uchar4 a, uchar4 b) {
- uchar4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline short4 __attribute__((const, overloadable))
- min(short4 a, short4 b) {
- short4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline ushort4 __attribute__((const, overloadable))
- min(ushort4 a, ushort4 b) {
- ushort4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline int4 __attribute__((const, overloadable))
- min(int4 a, int4 b) {
- int4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-static inline uint4 __attribute__((const, overloadable))
- min(uint4 a, uint4 b) {
- uint4 tmp;
- tmp.x = (a.x < b.x ? a.x : b.x);
- tmp.y = (a.y < b.y ? a.y : b.y);
- tmp.z = (a.z < b.z ? a.z : b.z);
- tmp.w = (a.w < b.w ? a.w : b.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char __attribute__((const, overloadable))
- min(char a, char b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char2 __attribute__((const, overloadable))
- min(char2 a, char2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char3 __attribute__((const, overloadable))
- min(char3 a, char3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern char4 __attribute__((const, overloadable))
- min(char4 a, char4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar __attribute__((const, overloadable))
- min(uchar a, uchar b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar2 __attribute__((const, overloadable))
- min(uchar2 a, uchar2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar3 __attribute__((const, overloadable))
- min(uchar3 a, uchar3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uchar4 __attribute__((const, overloadable))
- min(uchar4 a, uchar4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short __attribute__((const, overloadable))
- min(short a, short b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short2 __attribute__((const, overloadable))
- min(short2 a, short2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short3 __attribute__((const, overloadable))
- min(short3 a, short3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern short4 __attribute__((const, overloadable))
- min(short4 a, short4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort __attribute__((const, overloadable))
- min(ushort a, ushort b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort2 __attribute__((const, overloadable))
- min(ushort2 a, ushort2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort3 __attribute__((const, overloadable))
- min(ushort3 a, ushort3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ushort4 __attribute__((const, overloadable))
- min(ushort4 a, ushort4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int __attribute__((const, overloadable))
- min(int a, int b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int2 __attribute__((const, overloadable))
- min(int2 a, int2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int3 __attribute__((const, overloadable))
- min(int3 a, int3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern int4 __attribute__((const, overloadable))
- min(int4 a, int4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint __attribute__((const, overloadable))
- min(uint a, uint b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint2 __attribute__((const, overloadable))
- min(uint2 a, uint2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint3 __attribute__((const, overloadable))
- min(uint3 a, uint3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern uint4 __attribute__((const, overloadable))
- min(uint4 a, uint4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long __attribute__((const, overloadable))
- min(long a, long b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long2 __attribute__((const, overloadable))
- min(long2 a, long2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long3 __attribute__((const, overloadable))
- min(long3 a, long3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern long4 __attribute__((const, overloadable))
- min(long4 a, long4 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong __attribute__((const, overloadable))
- min(ulong a, ulong b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong2 __attribute__((const, overloadable))
- min(ulong2 a, ulong2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong3 __attribute__((const, overloadable))
- min(ulong3 a, ulong3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern ulong4 __attribute__((const, overloadable))
- min(ulong4 a, ulong4 b);
-#endif
-
-/*
- * mix: Mixes two values
- *
- * Returns start + ((stop - start) * fraction).
- *
- * This can be useful for mixing two values. For example, to create a new color that is 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
- */
-extern float __attribute__((const, overloadable))
- mix(float start, float stop, float fraction);
-
-extern float2 __attribute__((const, overloadable))
- mix(float2 start, float2 stop, float2 fraction);
-
-extern float3 __attribute__((const, overloadable))
- mix(float3 start, float3 stop, float3 fraction);
-
-extern float4 __attribute__((const, overloadable))
- mix(float4 start, float4 stop, float4 fraction);
-
-extern float2 __attribute__((const, overloadable))
- mix(float2 start, float2 stop, float fraction);
-
-extern float3 __attribute__((const, overloadable))
- mix(float3 start, float3 stop, float fraction);
-
-extern float4 __attribute__((const, overloadable))
- mix(float4 start, float4 stop, float fraction);
-
-/*
- * modf: Integral and fractional components
- *
- * Returns the integral and fractional components of a number.
- *
- * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
- *
- * Parameters:
- * v Source value
- * integral_part *integral_part will be set to the integral portion of the number.
- *
- * Returns: The floating point portion of the value.
- */
-extern float __attribute__((overloadable))
- modf(float v, float* integral_part);
-
-extern float2 __attribute__((overloadable))
- modf(float2 v, float2* integral_part);
-
-extern float3 __attribute__((overloadable))
- modf(float3 v, float3* integral_part);
-
-extern float4 __attribute__((overloadable))
- modf(float4 v, float4* integral_part);
-
-/*
- * nan: Not a Number
- *
- * Returns a NaN value (Not a Number).
- *
- * Parameters:
- * v Not used.
- */
-extern float __attribute__((const, overloadable))
- nan(uint v);
-
-/*
- * native_acos: Approximate inverse cosine
- *
- * Returns the approximate inverse cosine, in radians.
- *
- * This function yields undefined results from input values less than -1 or greater
- * than 1.
- *
- * See also acos().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_acos(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_acos(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_acos(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_acos(float4 v);
-#endif
-
-/*
- * native_acosh: Approximate inverse hyperbolic cosine
- *
- * Returns the approximate inverse hyperbolic cosine, in radians.
- *
- * See also acosh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_acosh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_acosh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_acosh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_acosh(float4 v);
-#endif
-
-/*
- * native_acospi: Approximate inverse cosine divided by pi
- *
- * Returns the approximate inverse cosine in radians, divided by pi.
- *
- * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
- *
- * This function yields undefined results from input values less than -1 or greater
- * than 1.
- *
- * See also acospi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_acospi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_acospi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_acospi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_acospi(float4 v);
-#endif
-
-/*
- * native_asin: Approximate inverse sine
- *
- * Returns the approximate inverse sine, in radians.
- *
- * This function yields undefined results from input values less than -1 or greater
- * than 1.
- *
- * See also asin().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_asin(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_asin(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_asin(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_asin(float4 v);
-#endif
-
-/*
- * native_asinh: Approximate inverse hyperbolic sine
- *
- * Returns the approximate inverse hyperbolic sine, in radians.
- *
- * See also asinh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_asinh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_asinh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_asinh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_asinh(float4 v);
-#endif
-
-/*
- * native_asinpi: Approximate inverse sine divided by pi
- *
- * Returns the approximate inverse sine in radians, divided by pi.
- *
- * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
- *
- * This function yields undefined results from input values less than -1 or greater
- * than 1.
- *
- * See also asinpi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_asinpi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_asinpi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_asinpi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_asinpi(float4 v);
-#endif
-
-/*
- * native_atan: Approximate inverse tangent
- *
- * Returns the approximate inverse tangent, in radians.
- *
- * See also atan().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_atan(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_atan(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_atan(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_atan(float4 v);
-#endif
-
-/*
- * native_atan2: Approximate inverse tangent of a ratio
- *
- * Returns the approximate inverse tangent of (numerator / denominator), in radians.
- *
- * See also atan2().
- *
- * Parameters:
- * numerator The numerator
- * denominator The denominator. Can be 0.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_atan2(float numerator, float denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_atan2(float2 numerator, float2 denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_atan2(float3 numerator, float3 denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_atan2(float4 numerator, float4 denominator);
-#endif
-
-/*
- * native_atan2pi: Approximate inverse tangent of a ratio, divided by pi
- *
- * Returns the approximate inverse tangent of (numerator / denominator), in radians, divided by pi.
- *
- * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
- *
- * See also atan2pi().
- *
- * Parameters:
- * numerator The numerator
- * denominator The denominator. Can be 0.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_atan2pi(float numerator, float denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_atan2pi(float2 numerator, float2 denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_atan2pi(float3 numerator, float3 denominator);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_atan2pi(float4 numerator, float4 denominator);
-#endif
-
-/*
- * native_atanh: Approximate inverse hyperbolic tangent
- *
- * Returns the approximate inverse hyperbolic tangent, in radians.
- *
- * See also atanh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_atanh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_atanh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_atanh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_atanh(float4 v);
-#endif
-
-/*
- * native_atanpi: Approximate inverse tangent divided by pi
- *
- * Returns the approximate inverse tangent in radians, divided by pi.
- *
- * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
- *
- * See also atanpi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_atanpi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_atanpi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_atanpi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_atanpi(float4 v);
-#endif
-
-/*
- * native_cbrt: Approximate cube root
- *
- * Returns the approximate cubic root.
- *
- * See also cbrt().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_cbrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_cbrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_cbrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_cbrt(float4 v);
-#endif
-
-/*
- * native_cos: Approximate cosine
- *
- * Returns the approximate cosine of an angle measured in radians.
- *
- * See also cos().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_cos(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_cos(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_cos(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_cos(float4 v);
-#endif
-
-/*
- * native_cosh: Approximate hypebolic cosine
- *
- * Returns the approximate hypebolic cosine.
- *
- * See also cosh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_cosh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_cosh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_cosh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_cosh(float4 v);
-#endif
-
-/*
- * native_cospi: Approximate cosine of a number multiplied by pi
- *
- * Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
- *
- * See also cospi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_cospi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_cospi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_cospi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_cospi(float4 v);
-#endif
-
-/*
- * native_distance: Approximate distance between two points
- *
- * Computes the approximate distance between two points.
- *
- * See also distance(), fast_distance().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_distance(float left_vector, float right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_distance(float2 left_vector, float2 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_distance(float3 left_vector, float3 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_distance(float4 left_vector, float4 right_vector);
-#endif
-
-/*
- * native_divide: Approximate division
- *
- * Computes the approximate division of two values.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_divide(float left_vector, float right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_divide(float2 left_vector, float2 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_divide(float3 left_vector, float3 right_vector);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_divide(float4 left_vector, float4 right_vector);
-#endif
-
-/*
- * native_exp: Approximate e raised to a number
- *
- * Fast approximate exp.
- *
- * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
- *
- * See also exp().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_exp(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_exp(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_exp(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_exp(float4 v);
-#endif
-
-/*
- * native_exp10: Approximate 10 raised to a number
- *
- * Fast approximate exp10.
- *
- * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
- *
- * See also exp10().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_exp10(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_exp10(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_exp10(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_exp10(float4 v);
-#endif
-
-/*
- * native_exp2: Approximate 2 raised to a number
- *
- * Fast approximate exp2.
- *
- * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
- *
- * See also exp2().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_exp2(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_exp2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_exp2(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_exp2(float4 v);
-#endif
-
-/*
- * native_expm1: Approximate e raised to a number minus one
- *
- * Returns the approximate (e ^ v) - 1.
- *
- * See also expm1().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_expm1(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_expm1(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_expm1(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_expm1(float4 v);
-#endif
-
-/*
- * native_hypot: Approximate hypotenuse
- *
- * Returns the approximate native_sqrt(a * a + b * b)
- *
- * See also hypot().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_hypot(float a, float b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_hypot(float2 a, float2 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_hypot(float3 a, float3 b);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_hypot(float4 a, float4 b);
-#endif
-
-/*
- * native_length: Approximate length of a vector
- *
- * Compute the approximate length of a vector.
- *
- * See also length(), fast_length().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_length(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_length(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_length(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_length(float4 v);
-#endif
-
-/*
- * native_log: Approximate natural logarithm
- *
- * Fast approximate log.
- *
- * It is not accurate for values very close to zero.
- *
- * See also log().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_log(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_log(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_log(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_log(float4 v);
-#endif
-
-/*
- * native_log10: Approximate base 10 logarithm
- *
- * Fast approximate log10.
- *
- * It is not accurate for values very close to zero.
- *
- * See also log10().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_log10(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_log10(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_log10(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_log10(float4 v);
-#endif
-
-/*
- * native_log1p: Approximate natural logarithm of a value plus 1
- *
- * Returns the approximate natural logarithm of (v + 1.0f)
- *
- * See also log1p().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_log1p(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_log1p(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_log1p(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_log1p(float4 v);
-#endif
-
-/*
- * native_log2: Approximate base 2 logarithm
- *
- * Fast approximate log2.
- *
- * It is not accurate for values very close to zero.
- *
- * See also log2().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_log2(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_log2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_log2(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_log2(float4 v);
-#endif
-
-/*
- * native_normalize: Approximately normalize a vector
- *
- * Approximately normalizes a vector.
- *
- * See also normalize(), fast_normalize().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_normalize(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_normalize(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_normalize(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_normalize(float4 v);
-#endif
-
-/*
- * native_powr: Approximate positive base raised to an exponent
- *
- * Fast approximate (base ^ exponent).
- *
- * See also powr().
- *
- * Parameters:
- * base Must be between 0.f and 256.f. The function is not accurate for values very close to zero.
- * exponent Must be between -15.f and 15.f.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float __attribute__((const, overloadable))
- native_powr(float base, float exponent);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float2 __attribute__((const, overloadable))
- native_powr(float2 base, float2 exponent);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float3 __attribute__((const, overloadable))
- native_powr(float3 base, float3 exponent);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-extern float4 __attribute__((const, overloadable))
- native_powr(float4 base, float4 exponent);
-#endif
-
-/*
- * native_recip: Approximate reciprocal
- *
- * Returns the approximate approximate reciprocal of a value.
- *
- * See also half_recip().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_recip(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_recip(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_recip(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_recip(float4 v);
-#endif
-
-/*
- * native_rootn: Approximate nth root
- *
- * Compute the approximate Nth root of a value.
- *
- * See also rootn().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_rootn(float v, int n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_rootn(float2 v, int2 n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_rootn(float3 v, int3 n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_rootn(float4 v, int4 n);
-#endif
-
-/*
- * native_rsqrt: Approximate reciprocal of a square root
- *
- * Returns approximate (1 / sqrt(v)).
- *
- * See also rsqrt(), half_rsqrt().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_rsqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_rsqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_rsqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_rsqrt(float4 v);
-#endif
-
-/*
- * native_sin: Approximate sine
- *
- * Returns the approximate sine of an angle measured in radians.
- *
- * See also sin().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_sin(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_sin(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_sin(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_sin(float4 v);
-#endif
-
-/*
- * native_sincos: Approximate sine and cosine
- *
- * Returns the approximate sine and cosine of a value.
- *
- * See also sincos().
- *
- * Parameters:
- * v The incoming value in radians.
- * cos *cos will be set to the cosine value.
- *
- * Returns: sine
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((overloadable))
- native_sincos(float v, float* cos);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((overloadable))
- native_sincos(float2 v, float2* cos);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((overloadable))
- native_sincos(float3 v, float3* cos);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((overloadable))
- native_sincos(float4 v, float4* cos);
-#endif
-
-/*
- * native_sinh: Approximate hyperbolic sine
- *
- * Returns the approximate hyperbolic sine of a value specified in radians.
- *
- * See also sinh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_sinh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_sinh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_sinh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_sinh(float4 v);
-#endif
-
-/*
- * native_sinpi: Approximate sine of a number multiplied by pi
- *
- * Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
- *
- * See also sinpi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_sinpi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_sinpi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_sinpi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_sinpi(float4 v);
-#endif
-
-/*
- * native_sqrt: Approximate square root
- *
- * Returns the approximate sqrt(v).
- *
- * See also sqrt(), half_sqrt().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_sqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_sqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_sqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_sqrt(float4 v);
-#endif
-
-/*
- * native_tan: Approximate tangent
- *
- * Returns the approximate tangent of an angle measured in radians.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_tan(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_tan(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_tan(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_tan(float4 v);
-#endif
-
-/*
- * native_tanh: Approximate hyperbolic tangent
- *
- * Returns the approximate hyperbolic tangent of a value.
- *
- * See also tanh().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_tanh(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_tanh(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_tanh(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_tanh(float4 v);
-#endif
-
-/*
- * native_tanpi: Approximate tangent of a number multiplied by pi
- *
- * Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
- *
- * See also tanpi().
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float __attribute__((const, overloadable))
- native_tanpi(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- native_tanpi(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- native_tanpi(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- native_tanpi(float4 v);
-#endif
-
-/*
- * nextafter: Next floating point number
- *
- * Returns the next representable floating point number from v towards target.
- *
- * In rs_fp_relaxed mode, a denormalized input value may not yield the next
- * denormalized value, as support of denormalized values is optional in
- * relaxed mode.
- */
-extern float __attribute__((const, overloadable))
- nextafter(float v, float target);
-
-extern float2 __attribute__((const, overloadable))
- nextafter(float2 v, float2 target);
-
-extern float3 __attribute__((const, overloadable))
- nextafter(float3 v, float3 target);
-
-extern float4 __attribute__((const, overloadable))
- nextafter(float4 v, float4 target);
-
-/*
- * normalize: Normalize a vector
- *
- * Normalize a vector.
- *
- * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
- *
- * See also fast_normalize(), native_normalize().
- */
-extern float __attribute__((const, overloadable))
- normalize(float v);
-
-extern float2 __attribute__((const, overloadable))
- normalize(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- normalize(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- normalize(float4 v);
-
-/*
- * pow: Base raised to an exponent
- *
- * Returns base raised to the power exponent, i.e. base ^ exponent.
- *
- * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
- */
-extern float __attribute__((const, overloadable))
- pow(float base, float exponent);
-
-extern float2 __attribute__((const, overloadable))
- pow(float2 base, float2 exponent);
-
-extern float3 __attribute__((const, overloadable))
- pow(float3 base, float3 exponent);
-
-extern float4 __attribute__((const, overloadable))
- pow(float4 base, float4 exponent);
-
-/*
- * pown: Base raised to an integer exponent
- *
- * Returns base raised to the power exponent, i.e. base ^ exponent.
- *
- * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
- */
-extern float __attribute__((const, overloadable))
- pown(float base, int exponent);
-
-extern float2 __attribute__((const, overloadable))
- pown(float2 base, int2 exponent);
-
-extern float3 __attribute__((const, overloadable))
- pown(float3 base, int3 exponent);
-
-extern float4 __attribute__((const, overloadable))
- pown(float4 base, int4 exponent);
-
-/*
- * powr: Positive base raised to an exponent
- *
- * Returns base raised to the power exponent, i.e. base ^ exponent. base must be >= 0.
- *
- * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
- *
- * See also native_powr().
- */
-extern float __attribute__((const, overloadable))
- powr(float base, float exponent);
-
-extern float2 __attribute__((const, overloadable))
- powr(float2 base, float2 exponent);
-
-extern float3 __attribute__((const, overloadable))
- powr(float3 base, float3 exponent);
-
-extern float4 __attribute__((const, overloadable))
- powr(float4 base, float4 exponent);
-
-/*
- * radians: Converts degrees into radians
- *
- * Converts from degrees to radians.
- */
-extern float __attribute__((const, overloadable))
- radians(float v);
-
-extern float2 __attribute__((const, overloadable))
- radians(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- radians(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- radians(float4 v);
-
-/*
- * remainder: Remainder of a division
- *
- * Returns the remainder of (numerator / denominator), where the quotient is rounded towards the nearest integer.
- *
- * The function fmod() is similar but rounds toward the closest interger.
- * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
- * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
- */
-extern float __attribute__((const, overloadable))
- remainder(float numerator, float denominator);
-
-extern float2 __attribute__((const, overloadable))
- remainder(float2 numerator, float2 denominator);
-
-extern float3 __attribute__((const, overloadable))
- remainder(float3 numerator, float3 denominator);
-
-extern float4 __attribute__((const, overloadable))
- remainder(float4 numerator, float4 denominator);
-
-/*
- * remquo: Remainder and quotient of a division
- *
- * Returns the quotient and the remainder of (numerator / denominator).
- *
- * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
- *
- * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
- *
- * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
- *
- * Parameters:
- * numerator The numerator.
- * denominator The denominator.
- * quotient *quotient will be set to the integer quotient.
- *
- * Returns: The remainder, precise only for the low three bits.
- */
-extern float __attribute__((overloadable))
- remquo(float numerator, float denominator, int* quotient);
-
-extern float2 __attribute__((overloadable))
- remquo(float2 numerator, float2 denominator, int2* quotient);
-
-extern float3 __attribute__((overloadable))
- remquo(float3 numerator, float3 denominator, int3* quotient);
-
-extern float4 __attribute__((overloadable))
- remquo(float4 numerator, float4 denominator, int4* quotient);
-
-/*
- * rint: Round to even
- *
- * Rounds to the nearest integral value.
- *
- * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
- *
- * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
- */
-extern float __attribute__((const, overloadable))
- rint(float v);
-
-extern float2 __attribute__((const, overloadable))
- rint(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- rint(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- rint(float4 v);
-
-/*
- * rootn: Nth root
- *
- * Compute the Nth root of a value.
- *
- * See also native_rootn().
- */
-extern float __attribute__((const, overloadable))
- rootn(float v, int n);
-
-extern float2 __attribute__((const, overloadable))
- rootn(float2 v, int2 n);
-
-extern float3 __attribute__((const, overloadable))
- rootn(float3 v, int3 n);
-
-extern float4 __attribute__((const, overloadable))
- rootn(float4 v, int4 n);
-
-/*
- * round: Round away from zero
- *
- * Round to the nearest integral value.
- *
- * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
- *
- * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
- */
-extern float __attribute__((const, overloadable))
- round(float v);
-
-extern float2 __attribute__((const, overloadable))
- round(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- round(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- round(float4 v);
-
-/*
- * rsqrt: Reciprocal of a square root
- *
- * Returns (1 / sqrt(v)).
- *
- * See also half_rsqrt(), native_rsqrt().
- */
-extern float __attribute__((const, overloadable))
- rsqrt(float v);
-
-extern float2 __attribute__((const, overloadable))
- rsqrt(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- rsqrt(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- rsqrt(float4 v);
-
-/*
- * sign: Sign of a value
- *
- * Returns the sign of a value.
- *
- * if (v < 0) return -1.f;
- * else if (v > 0) return 1.f;
- * else return 0.f;
- */
-extern float __attribute__((const, overloadable))
- sign(float v);
-
-extern float2 __attribute__((const, overloadable))
- sign(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- sign(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- sign(float4 v);
-
-/*
- * sin: Sine
- *
- * Returns the sine of an angle measured in radians.
- *
- * See also native_sin().
- */
-extern float __attribute__((const, overloadable))
- sin(float v);
-
-extern float2 __attribute__((const, overloadable))
- sin(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- sin(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- sin(float4 v);
-
-/*
- * sincos: Sine and cosine
- *
- * Returns the sine and cosine of a value.
- *
- * See also native_sincos().
- *
- * Parameters:
- * v The incoming value in radians
- * cos *cos will be set to the cosine value.
- *
- * Returns: sine of v
- */
-extern float __attribute__((overloadable))
- sincos(float v, float* cos);
-
-extern float2 __attribute__((overloadable))
- sincos(float2 v, float2* cos);
-
-extern float3 __attribute__((overloadable))
- sincos(float3 v, float3* cos);
-
-extern float4 __attribute__((overloadable))
- sincos(float4 v, float4* cos);
-
-/*
- * sinh: Hyperbolic sine
- *
- * Returns the hyperbolic sine of v, where v is measured in radians.
- *
- * See also native_sinh().
- */
-extern float __attribute__((const, overloadable))
- sinh(float v);
-
-extern float2 __attribute__((const, overloadable))
- sinh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- sinh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- sinh(float4 v);
-
-/*
- * sinpi: Sine of a number multiplied by pi
- *
- * Returns the sine of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
- *
- * See also native_sinpi().
- */
-extern float __attribute__((const, overloadable))
- sinpi(float v);
-
-extern float2 __attribute__((const, overloadable))
- sinpi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- sinpi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- sinpi(float4 v);
-
-/*
- * sqrt: Square root
- *
- * Returns the square root of a value.
- *
- * See also half_sqrt(), native_sqrt().
- */
-extern float __attribute__((const, overloadable))
- sqrt(float v);
-
-extern float2 __attribute__((const, overloadable))
- sqrt(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- sqrt(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- sqrt(float4 v);
-
-/*
- * step: 0 if less than a value, 0 otherwise
- *
- * Returns 0.f if v < edge, 1.f otherwise.
- *
- * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
- */
-extern float __attribute__((const, overloadable))
- step(float edge, float v);
-
-extern float2 __attribute__((const, overloadable))
- step(float2 edge, float2 v);
-
-extern float3 __attribute__((const, overloadable))
- step(float3 edge, float3 v);
-
-extern float4 __attribute__((const, overloadable))
- step(float4 edge, float4 v);
-
-extern float2 __attribute__((const, overloadable))
- step(float2 edge, float v);
-
-extern float3 __attribute__((const, overloadable))
- step(float3 edge, float v);
-
-extern float4 __attribute__((const, overloadable))
- step(float4 edge, float v);
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float2 __attribute__((const, overloadable))
- step(float edge, float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float3 __attribute__((const, overloadable))
- step(float edge, float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-extern float4 __attribute__((const, overloadable))
- step(float edge, float4 v);
-#endif
-
-/*
- * tan: Tangent
- *
- * Returns the tangent of an angle measured in radians.
- *
- * See also native_tan().
- */
-extern float __attribute__((const, overloadable))
- tan(float v);
-
-extern float2 __attribute__((const, overloadable))
- tan(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- tan(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- tan(float4 v);
-
-/*
- * tanh: Hyperbolic tangent
- *
- * Returns the hyperbolic tangent of a value.
- *
- * See also native_tanh().
- */
-extern float __attribute__((const, overloadable))
- tanh(float v);
-
-extern float2 __attribute__((const, overloadable))
- tanh(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- tanh(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- tanh(float4 v);
-
-/*
- * tanpi: Tangent of a number multiplied by pi
- *
- * Returns the tangent of (v * pi), where (v * pi) is measured in radians.
- *
- * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
- *
- * See also native_tanpi().
- */
-extern float __attribute__((const, overloadable))
- tanpi(float v);
-
-extern float2 __attribute__((const, overloadable))
- tanpi(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- tanpi(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- tanpi(float4 v);
-
-/*
- * tgamma: Gamma function
- *
- * Returns the gamma function of a value.
- *
- * See also lgamma().
- */
-extern float __attribute__((const, overloadable))
- tgamma(float v);
-
-extern float2 __attribute__((const, overloadable))
- tgamma(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- tgamma(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- tgamma(float4 v);
-
-/*
- * trunc: Truncates a floating point
- *
- * Rounds to integral using truncation.
- *
- * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
- *
- * See rint() and round() for other rounding options.
- */
-extern float __attribute__((const, overloadable))
- trunc(float v);
-
-extern float2 __attribute__((const, overloadable))
- trunc(float2 v);
-
-extern float3 __attribute__((const, overloadable))
- trunc(float3 v);
-
-extern float4 __attribute__((const, overloadable))
- trunc(float4 v);
-
-#endif // RENDERSCRIPT_RS_CORE_MATH_RSH
diff --git a/renderscript/include/rs_dct.rsh b/renderscript/include/rs_dct.rsh
deleted file mode 100644
index d7289dd..0000000
--- a/renderscript/include/rs_dct.rsh
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __RS_DCT_RSH__
-#define __RS_DCT_RSH__
-
-#if RS_VERSION > 19
-
-extern void rsDct4x4(rs_allocation input, rs_allocation output, int xoff, int yoff);
-extern void rsDct8x8(rs_allocation input, rs_allocation output, int xoff, int yoff);
-extern void rsDct16x16(rs_allocation input, rs_allocation output, int xoff, int yoff);
-extern void rsDct32x32(rs_allocation input, rs_allocation out, int xoff, int yoff);
-extern void rsDct32x32_rd(rs_allocation input, rs_allocation out, int xoff, int yoff);
-
-#endif
-
-#endif
diff --git a/renderscript/include/rs_fadst.rsh b/renderscript/include/rs_fadst.rsh
deleted file mode 100644
index 1dfe58f..0000000
--- a/renderscript/include/rs_fadst.rsh
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __RS_FADST_RSH__
-#define __RS_FADST_RSH__
-
-#if RS_VERSION > 19
-
-extern void rsFadst4(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-extern void rsFadst8(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-extern void rsFadst16(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-#endif
-
-#endif \ No newline at end of file
diff --git a/renderscript/include/rs_for_each.rsh b/renderscript/include/rs_for_each.rsh
new file mode 100644
index 0000000..0a1e3a1
--- /dev/null
+++ b/renderscript/include/rs_for_each.rsh
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_for_each.rsh: TODO Add documentation
+ *
+ * TODO Add documentation
+ */
+#ifndef RENDERSCRIPT_RS_FOR_EACH_RSH
+#define RENDERSCRIPT_RS_FOR_EACH_RSH
+
+/*
+ * rs_for_each_strategy_t: Launch order hint for rsForEach calls
+ *
+ * Launch order hint for rsForEach calls. This provides a hint to the system to
+ * determine in which order the root function of the target is called with each
+ * cell of the allocation.
+ *
+ * This is a hint and implementations may not obey the order.
+ */
+typedef enum rs_for_each_strategy {
+ RS_FOR_EACH_STRATEGY_SERIAL = 0,
+ RS_FOR_EACH_STRATEGY_DONT_CARE = 1,
+ RS_FOR_EACH_STRATEGY_DST_LINEAR = 2,
+ RS_FOR_EACH_STRATEGY_TILE_SMALL = 3,
+ RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4,
+ RS_FOR_EACH_STRATEGY_TILE_LARGE = 5
+} rs_for_each_strategy_t;
+
+/*
+ * rs_kernel_context: Opaque handle to RenderScript kernel invocation context
+ *
+ * TODO
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+typedef const struct rs_kernel_context_t * rs_kernel_context;
+#endif
+
+/*
+ * rs_script_call_t: Provides extra information to a rsForEach call
+ *
+ * Structure to provide extra information to a rsForEach call. Primarly used to
+ * restrict the call to a subset of cells in the allocation.
+ */
+typedef struct rs_script_call {
+ rs_for_each_strategy_t strategy;
+ uint32_t xStart;
+ uint32_t xEnd;
+ uint32_t yStart;
+ uint32_t yEnd;
+ uint32_t zStart;
+ uint32_t zEnd;
+ uint32_t arrayStart;
+ uint32_t arrayEnd;
+} rs_script_call_t;
+
+/*
+ * Make a script to script call to launch work. One of the input or output is
+ * required to be a valid object. The input and output must be of the same
+ * dimensions.
+ *
+ * Parameters:
+ * script The target script to call
+ * input The allocation to source data from
+ * output the allocation to write date into
+ * usrData The user defined params to pass to the root script. May be NULL.
+ * sc Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL.
+ * usrDataLen The size of the userData structure. This will be used to perform a shallow copy of the data if necessary.
+ */
+#if !defined(RS_VERSION) || (RS_VERSION <= 13)
+extern void __attribute__((overloadable))
+ rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
+ const rs_script_call_t* sc);
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 13)
+extern void __attribute__((overloadable))
+ rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
+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* sc);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
+extern void __attribute__((overloadable))
+ rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
+ size_t usrDataLen);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+extern void __attribute__((overloadable))
+ rsForEach(rs_script script, rs_allocation input, rs_allocation output);
+#endif
+
+/*
+ * rsGetArray0: Index in the Array0 dimension for the specified context
+ *
+ * Returns the index in the Array0 dimension of the cell being processed,
+ * as specified by the supplied context.
+ *
+ * This context is created when a kernel is launched and updated at each
+ * iteration. It contains common characteristics of the allocations being
+ * iterated over and rarely used indexes, like the Array0 index.
+ *
+ * You can access the context by adding a rs_kernel_context argument to your
+ * kernel function. E.g.
+ * short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {
+ * // The current index in the common x, y, z, w dimensions are accessed by
+ * // adding these variables as arguments. For the more rarely used indexes
+ * // to the other dimensions, extract them from the context:
+ * uint32_t index_a0 = rsGetArray0(context);
+ * //...
+ * }
+ *
+ * This function returns 0 if the Array0 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetArray0(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetArray1: Index in the Array1 dimension for the specified context
+ *
+ * Returns the index in the Array1 dimension of the cell being processed,
+ * as specified by the supplied context. See rsGetArray0() for an explanation
+ * of the context.
+ *
+ * Returns 0 if the Array1 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetArray1(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetArray2: Index in the Array2 dimension for the specified context
+ *
+ * Returns the index in the Array2 dimension of the cell being processed,
+ * as specified by the supplied context. See rsGetArray0() for an explanation
+ * of the context.
+ *
+ * Returns 0 if the Array2 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetArray2(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetArray3: Index in the Array3 dimension for the specified context
+ *
+ * Returns the index in the Array3 dimension of the cell being processed,
+ * as specified by the supplied context. See rsGetArray0() for an explanation
+ * of the context.
+ *
+ * Returns 0 if the Array3 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetArray3(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimArray0: Size of the Array0 dimension for the specified context
+ *
+ * Returns the size of the Array0 dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Array0 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimArray0(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimArray1: Size of the Array1 dimension for the specified context
+ *
+ * Returns the size of the Array1 dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Array1 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimArray1(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimArray2: Size of the Array2 dimension for the specified context
+ *
+ * Returns the size of the Array2 dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Array2 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimArray2(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimArray3: Size of the Array3 dimension for the specified context
+ *
+ * Returns the size of the Array3 dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Array3 dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimArray3(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimHasFaces: Presence of more than one face for the specified context
+ *
+ * If the context refers to a cubemap, this function returns true if there's
+ * more than one face present. In all other cases, it returns false.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool.
+ *
+ * Returns: Returns true if more than one face is present, false otherwise.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern bool __attribute__((overloadable))
+ rsGetDimHasFaces(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimLod: Number of levels of detail for the specified context
+ *
+ * Returns the number of levels of detail for the specified context.
+ * This is useful for mipmaps. See rsGetDimX() for an explanation of the context.
+ * Returns 0 if Level of Detail is not used.
+ *
+ * rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual
+ * number of levels.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimLod(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimX: Size of the X dimension for the specified context
+ *
+ * Returns the size of the X dimension for the specified context.
+ *
+ * This context is created when a kernel is launched. It contains common
+ * characteristics of the allocations being iterated over by the kernel in
+ * a very efficient structure. It also contains rarely used indexes.
+ *
+ * You can access it by adding a rs_kernel_context argument to your kernel
+ * function. E.g.
+ * int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {
+ * uint32_t size = rsGetDimX(context); //...
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimX(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimY: Size of the Y dimension for the specified context
+ *
+ * Returns the size of the X dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Y dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimY(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetDimZ: Size of the Z dimension for the specified context
+ *
+ * Returns the size of the Z dimension for the specified context.
+ * See rsGetDimX() for an explanation of the context.
+ *
+ * Returns 0 if the Z dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetDimZ(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetFace: Coordinate of the Face for the specified context
+ *
+ * Returns the face on which the cell being processed is found, as specified
+ * by the supplied context. See rsGetArray0() for an explanation of the context.
+ *
+ * Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
+ * present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern rs_allocation_cubemap_face __attribute__((overloadable))
+ rsGetFace(rs_kernel_context ctxt);
+#endif
+
+/*
+ * rsGetLod: Index in the Levels of Detail dimension for the specified context.
+ *
+ * Returns the index in the Levels of Detail dimension of the cell being
+ * processed, as specified by the supplied context. See rsGetArray0() for
+ * an explanation of the context.
+ *
+ * Returns 0 if the Levels of Detail dimension is not present.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern uint32_t __attribute__((overloadable))
+ rsGetLod(rs_kernel_context ctxt);
+#endif
+
+#endif // RENDERSCRIPT_RS_FOR_EACH_RSH
diff --git a/renderscript/include/rs_graphics.rsh b/renderscript/include/rs_graphics.rsh
index 1f74518..6742290 100644
--- a/renderscript/include/rs_graphics.rsh
+++ b/renderscript/include/rs_graphics.rsh
@@ -19,6 +19,8 @@
/*
* rs_graphics.rsh: RenderScript graphics API
*
+ * NOTE: RenderScript Graphics has been deprecated. Do not use.
+ *
* A set of graphics functions used by RenderScript.
*/
#ifndef RENDERSCRIPT_RS_GRAPHICS_RSH
@@ -27,9 +29,267 @@
#ifdef __LP64__
// TODO We need to fix some of the builds before enabling this error:
// #error "RenderScript graphics is deprecated and not supported in 64bit mode."
-#else
-#include "rs_mesh.rsh"
-#include "rs_program.rsh"
+#endif
+
+// TODO we seem to assume order for the other headers too.
+#include "rs_object_types.rsh"
+
+/*
+ * rs_blend_src_func: Blend source function
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_BLEND_SRC_ZERO = 0,
+ RS_BLEND_SRC_ONE = 1,
+ RS_BLEND_SRC_DST_COLOR = 2,
+ RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3,
+ RS_BLEND_SRC_SRC_ALPHA = 4,
+ RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5,
+ RS_BLEND_SRC_DST_ALPHA = 6,
+ RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7,
+ RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8,
+ RS_BLEND_SRC_INVALID = 100
+} rs_blend_src_func;
+#endif
+#endif
+
+/*
+ * rs_blend_dst_func: Blend destination function
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_BLEND_DST_ZERO = 0,
+ RS_BLEND_DST_ONE = 1,
+ RS_BLEND_DST_SRC_COLOR = 2,
+ RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3,
+ RS_BLEND_DST_SRC_ALPHA = 4,
+ RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5,
+ RS_BLEND_DST_DST_ALPHA = 6,
+ RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7,
+ RS_BLEND_DST_INVALID = 100
+} rs_blend_dst_func;
+#endif
+#endif
+
+/*
+ * rs_cull_mode: Culling mode
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_CULL_BACK = 0,
+ RS_CULL_FRONT = 1,
+ RS_CULL_NONE = 2,
+ RS_CULL_INVALID = 100
+} rs_cull_mode;
+#endif
+#endif
+
+/*
+ * rs_depth_func: Depth function
+ *
+ * Specifies conditional drawing depending on the comparison of the incoming
+ * depth to that found in the depth buffer.
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
+ RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
+ RS_DEPTH_FUNC_LEQUAL = 2, // Drawn if the incoming depth value is less or equal to that in the depth buffer
+ RS_DEPTH_FUNC_GREATER = 3, // Drawn if the incoming depth value is greater than that in the depth buffer
+ RS_DEPTH_FUNC_GEQUAL = 4, // Drawn if the incoming depth value is greater or equal to that in the depth buffer
+ RS_DEPTH_FUNC_EQUAL = 5, // Drawn if the incoming depth value is equal to that in the depth buffer
+ RS_DEPTH_FUNC_NOTEQUAL = 6, // Drawn if the incoming depth value is not equal to that in the depth buffer
+ RS_DEPTH_FUNC_INVALID = 100 // Invalid depth function
+} rs_depth_func;
+#endif
+#endif
+
+/*
+ * rs_primitive: How to intepret mesh vertex data
+ *
+ * Describes the way mesh vertex data is interpreted when rendering
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
+ RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
+ RS_PRIMITIVE_LINE_STRIP = 2, // Vertex data will be rendered as a connected line strip
+ RS_PRIMITIVE_TRIANGLE = 3, // Vertices will be rendered as individual triangles
+ RS_PRIMITIVE_TRIANGLE_STRIP = 4, // Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex
+ RS_PRIMITIVE_TRIANGLE_FAN = 5, // Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
+ RS_PRIMITIVE_INVALID = 100 // Invalid primitive
+} rs_primitive;
+#endif
+#endif
+
+/*
+ * rs_font: Handle to a Font
+ *
+ * Opaque handle to a RenderScript font object.
+ * See: android.renderscript.Font
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_font;
+#endif
+
+/*
+ * rs_mesh: Handle to a Mesh
+ *
+ * Opaque handle to a RenderScript mesh object.
+ * See: android.renderscript.Mesh
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_mesh;
+#endif
+
+/*
+ * rs_program_fragment: Handle to a ProgramFragment
+ *
+ * Opaque handle to a RenderScript ProgramFragment object.
+ * See: android.renderscript.ProgramFragment
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_program_fragment;
+#endif
+
+/*
+ * rs_program_vertex: Handle to a ProgramVertex
+ *
+ * Opaque handle to a RenderScript ProgramVertex object.
+ * See: android.renderscript.ProgramVertex
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_program_vertex;
+#endif
+
+/*
+ * rs_program_raster: Handle to a ProgramRaster
+ *
+ * Opaque handle to a RenderScript ProgramRaster object.
+ * See: android.renderscript.ProgramRaster
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_program_raster;
+#endif
+
+/*
+ * rs_program_store: Handle to a ProgramStore
+ *
+ * Opaque handle to a RenderScript ProgramStore object.
+ * See: android.renderscript.ProgramStore
+ */
+#ifndef __LP64__
+typedef _RS_HANDLE rs_program_store;
+#endif
+
+/*
+ * rsClearObject: For internal use.
+ *
+ */
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_mesh* dst);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_fragment* dst);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_vertex* dst);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_raster* dst);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_store* dst);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsClearObject(rs_font* dst);
+#endif
+
+/*
+ * rsIsObject: For internal use.
+ *
+ */
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_mesh v);
+#endif
+
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_fragment v);
+#endif
+
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_vertex v);
+#endif
+
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_raster v);
+#endif
+
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_store v);
+#endif
+
+#ifndef __LP64__
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_font v);
+#endif
+
+/*
+ * rsSetObject: For internal use.
+ *
+ */
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_mesh* dst, rs_mesh src);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_fragment* dst, rs_program_fragment src);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_vertex* dst, rs_program_vertex src);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_raster* dst, rs_program_raster src);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_store* dst, rs_program_store src);
+#endif
+
+#ifndef __LP64__
+extern void __attribute__((overloadable))
+ rsSetObject(rs_font* dst, rs_font src);
#endif
/*
@@ -364,6 +624,89 @@ static inline void __attribute__((always_inline, overloadable))
#endif
/*
+ * Returns an allocation containing index data or a null
+ * allocation if only the primitive is specified
+ *
+ * Parameters:
+ * m mesh to get data from
+ * index index of the index allocation
+ *
+ * Returns: allocation containing index data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_allocation __attribute__((overloadable))
+ rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * Returns the primitive describing how a part of the mesh is
+ * rendered
+ *
+ * Parameters:
+ * m mesh to get data from
+ * index index of the primitive
+ *
+ * Returns: primitive describing how the mesh is rendered
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_primitive __attribute__((overloadable))
+ rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * Meshes could have multiple index sets, this function returns
+ * the number.
+ *
+ * Parameters:
+ * m mesh to get data from
+ *
+ * Returns: number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern uint32_t __attribute__((overloadable))
+ rsgMeshGetPrimitiveCount(rs_mesh m);
+#endif
+#endif
+
+/*
+ * Returns an allocation that is part of the mesh and contains
+ * vertex data, e.g. positions, normals, texcoords
+ *
+ * Parameters:
+ * m mesh to get data from
+ * index index of the vertex allocation
+ *
+ * Returns: allocation containing vertex data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_allocation __attribute__((overloadable))
+ rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * Returns the number of allocations in the mesh that contain
+ * vertex data
+ *
+ * Parameters:
+ * m mesh to get data from
+ *
+ * Returns: number of allocations in the mesh that contain vertex data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern uint32_t __attribute__((overloadable))
+ rsgMeshGetVertexAllocationCount(rs_mesh m);
+#endif
+#endif
+
+/*
* Set the constant color for a fixed function emulation program.
*/
#ifndef __LP64__
@@ -423,4 +766,147 @@ extern void __attribute__((overloadable))
rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex);
#endif
+/*
+ * Get program raster cull mode
+ *
+ * Parameters:
+ * pr program raster to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_cull_mode __attribute__((overloadable))
+ rsgProgramRasterGetCullMode(rs_program_raster pr);
+#endif
+#endif
+
+/*
+ * Get program raster point sprite state
+ *
+ * Parameters:
+ * pr program raster to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr);
+#endif
+#endif
+
+/*
+ * Get program store blend destination function
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_blend_dst_func __attribute__((overloadable))
+ rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store blend source function
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_blend_src_func __attribute__((overloadable))
+ rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store depth function
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_depth_func __attribute__((overloadable))
+ rsgProgramStoreGetDepthFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store alpha component color mask
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store blur component color mask
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store green component color mask
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store red component color mask
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store depth mask
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * Get program store dither state
+ *
+ * Parameters:
+ * ps program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern bool __attribute__((overloadable))
+ rsgProgramStoreIsDitherEnabled(rs_program_store ps);
+#endif
+#endif
+
#endif // RENDERSCRIPT_RS_GRAPHICS_RSH
diff --git a/renderscript/include/rs_iadst.rsh b/renderscript/include/rs_iadst.rsh
deleted file mode 100644
index 3208814..0000000
--- a/renderscript/include/rs_iadst.rsh
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __RS_IADST_RSH__
-#define __RS_IADST_RSH__
-
-#if RS_VERSION > 19
-
-extern void rsIadst4(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-extern void rsIadst8(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-extern void rsIadst16(const rs_allocation input, rs_allocation output, int32_t xoff);
-
-#endif
-
-#endif \ No newline at end of file
diff --git a/renderscript/include/rs_idct.rsh b/renderscript/include/rs_idct.rsh
deleted file mode 100644
index d602e34..0000000
--- a/renderscript/include/rs_idct.rsh
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __RS_IDCT_RSH__
-#define __RS_IDCT_RSH__
-
-#if RS_VERSION > 19
-
-extern void rsIdct4x4(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
-extern void rsIdct8x8(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
-extern void rsIdct16x16(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
-extern void rsIdct32x32(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
-
-#endif
-
-#endif
diff --git a/renderscript/include/rs_io.rsh b/renderscript/include/rs_io.rsh
new file mode 100644
index 0000000..d523f29
--- /dev/null
+++ b/renderscript/include/rs_io.rsh
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_io.rsh: Input/output functions
+ *
+ * TODO Add documentation
+ */
+#ifndef RENDERSCRIPT_RS_IO_RSH
+#define RENDERSCRIPT_RS_IO_RSH
+
+/*
+ * rsAllocationIoReceive: Receive new content from the queue
+ *
+ * Receive a new set of contents from the queue.
+ *
+ * Parameters:
+ * a allocation to work on
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern void __attribute__((overloadable))
+ rsAllocationIoReceive(rs_allocation a);
+#endif
+
+/*
+ * rsAllocationIoSend: Send new content to the queue
+ *
+ * Send the contents of the Allocation to the queue.
+ *
+ * Parameters:
+ * a allocation to work on
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern void __attribute__((overloadable))
+ rsAllocationIoSend(rs_allocation a);
+#endif
+
+/*
+ * Send a message back to the client. Will not block and returns true
+ * if the message was sendable and false if the fifo was full.
+ * A message ID is required. Data payload is optional.
+ */
+extern bool __attribute__((overloadable))
+ rsSendToClient(int cmdID);
+
+extern bool __attribute__((overloadable))
+ rsSendToClient(int cmdID, const void* data, uint len);
+
+/*
+ * Send a message back to the client, blocking until the message is queued.
+ * A message ID is required. Data payload is optional.
+ */
+extern void __attribute__((overloadable))
+ rsSendToClientBlocking(int cmdID);
+
+extern void __attribute__((overloadable))
+ rsSendToClientBlocking(int cmdID, const void* data, uint len);
+
+#endif // RENDERSCRIPT_RS_IO_RSH
diff --git a/renderscript/include/rs_math.rsh b/renderscript/include/rs_math.rsh
index b6b6ee0..b812f07 100644
--- a/renderscript/include/rs_math.rsh
+++ b/renderscript/include/rs_math.rsh
@@ -17,14 +17,4043 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
/*
- * rs_math.rsh: TODO Add documentation
+ * rs_math.rsh: Mathematical functions
+ *
+ * Most mathematical functions can be applied to scalars and vectors.
+ * When applied to vectors, a vector of the function applied to each entry
+ * of the input is returned.
+ *
+ * For example:
+ *
+ * float3 a, b;
+ * // The following call sets
+ * // a.x to sin(b.x),
+ * // a.y to sin(b.y), and
+ * // a.z to sin(b.z).
+ * a = sin(b);
+ *
+ *
+ * A few functions like distance() and length() interpret instead the input
+ * as a single vector in n-dimensional space.
+ *
+ * The precision of the mathematical operations is affected by the pragmas
+ * rs_fp_relaxed and rs_fp_full.
+ *
+ * Different precision/speed tradeoffs can be achieved by using three variants
+ * of common math functions. Functions with a name starting with
+ * native_ may have custom hardware implementations with weaker precision,
+ * half_ may perform internal computations using 16 bit floats, and
+ * fast_ are n-dimensional space computations that may use 16 bit floats.
*
- * TODO Add documentation
*/
#ifndef RENDERSCRIPT_RS_MATH_RSH
#define RENDERSCRIPT_RS_MATH_RSH
/*
+ * M_1_PI: 1 / pi, as a 32 bit float
+ *
+ * The inverse of pi, as a 32 bit float.
+ */
+#define M_1_PI 0.318309886183790671537767526745028724f
+
+/*
+ * M_2_PI: 2 / pi, as a 32 bit float
+ *
+ * 2 divided by pi, as a 32 bit float.
+ */
+#define M_2_PI 0.636619772367581343075535053490057448f
+
+/*
+ * M_2_PIl: Deprecated. Use M_2_PI instead.
+ *
+ */
+#define M_2_PIl 0.636619772367581343075535053490057448f
+
+/*
+ * M_2_SQRTPI: 2 / sqrt(pi), as a 32 bit float
+ *
+ * 2 divided by the square root of pi, as a 32 bit float.
+ */
+#define M_2_SQRTPI 1.128379167095512573896158903121545172f
+
+/*
+ * M_E: e, as a 32 bit float
+ *
+ * The number e, the base of the natural logarithm, as a 32 bit float.
+ */
+#define M_E 2.718281828459045235360287471352662498f
+
+/*
+ * M_LN10: log_e(10), as a 32 bit float
+ *
+ * The natural logarithm of 10, as a 32 bit float.
+ */
+#define M_LN10 2.302585092994045684017991454684364208f
+
+/*
+ * M_LN2: log_e(2), as a 32 bit float
+ *
+ * The natural logarithm of 2, as a 32 bit float.
+ */
+#define M_LN2 0.693147180559945309417232121458176568f
+
+/*
+ * M_LOG10E: log_10(e), as a 32 bit float
+ *
+ * The logarithm base 10 of e, as a 32 bit float.
+ */
+#define M_LOG10E 0.434294481903251827651128918916605082f
+
+/*
+ * M_LOG2E: log_2(e), as a 32 bit float
+ *
+ * The logarithm base 2 of e, as a 32 bit float.
+ */
+#define M_LOG2E 1.442695040888963407359924681001892137f
+
+/*
+ * M_PI: pi, as a 32 bit float
+ *
+ * The constant pi, as a 32 bit float.
+ */
+#define M_PI 3.141592653589793238462643383279502884f
+
+/*
+ * M_PI_2: pi / 2, as a 32 bit float
+ *
+ * Pi divided by 2, as a 32 bit float.
+ */
+#define M_PI_2 1.570796326794896619231321691639751442f
+
+/*
+ * M_PI_4: pi / 4, as a 32 bit float
+ *
+ * Pi divided by 4, as a 32 bit float.
+ */
+#define M_PI_4 0.785398163397448309615660845819875721f
+
+/*
+ * M_SQRT1_2: 1 / sqrt(2), as a 32 bit float
+ *
+ * The inverse of the square root of 2, as a 32 bit float.
+ */
+#define M_SQRT1_2 0.707106781186547524400844362104849039f
+
+/*
+ * M_SQRT2: sqrt(2), as a 32 bit float
+ *
+ * The square root of 2, as a 32 bit float.
+ */
+#define M_SQRT2 1.414213562373095048801688724209698079f
+
+/*
+ * abs: Absolute value of an integer
+ *
+ * Returns the absolute value of an integer.
+ *
+ * For floats, use fabs().
+ */
+extern uchar __attribute__((const, overloadable))
+ abs(char v);
+
+extern uchar2 __attribute__((const, overloadable))
+ abs(char2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ abs(char3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ abs(char4 v);
+
+extern ushort __attribute__((const, overloadable))
+ abs(short v);
+
+extern ushort2 __attribute__((const, overloadable))
+ abs(short2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ abs(short3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ abs(short4 v);
+
+extern uint __attribute__((const, overloadable))
+ abs(int v);
+
+extern uint2 __attribute__((const, overloadable))
+ abs(int2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ abs(int3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ abs(int4 v);
+
+/*
+ * acos: Inverse cosine
+ *
+ * Returns the inverse cosine, in radians.
+ *
+ * See also native_acos().
+ */
+extern float __attribute__((const, overloadable))
+ acos(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acos(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acos(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acos(float4 v);
+
+/*
+ * acosh: Inverse hyperbolic cosine
+ *
+ * Returns the inverse hyperbolic cosine, in radians.
+ *
+ * See also native_acosh().
+ */
+extern float __attribute__((const, overloadable))
+ acosh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acosh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acosh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acosh(float4 v);
+
+/*
+ * acospi: Inverse cosine divided by pi
+ *
+ * Returns the inverse cosine in radians, divided by pi.
+ *
+ * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
+ *
+ * See also native_acospi().
+ */
+extern float __attribute__((const, overloadable))
+ acospi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acospi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acospi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acospi(float4 v);
+
+/*
+ * asin: Inverse sine
+ *
+ * Returns the inverse sine, in radians.
+ *
+ * See also native_asin().
+ */
+extern float __attribute__((const, overloadable))
+ asin(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asin(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asin(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asin(float4 v);
+
+/*
+ * asinh: Inverse hyperbolic sine
+ *
+ * Returns the inverse hyperbolic sine, in radians.
+ *
+ * See also native_asinh().
+ */
+extern float __attribute__((const, overloadable))
+ asinh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asinh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asinh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asinh(float4 v);
+
+/*
+ * asinpi: Inverse sine divided by pi
+ *
+ * Returns the inverse sine in radians, divided by pi.
+ *
+ * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
+ *
+ * See also native_asinpi().
+ */
+extern float __attribute__((const, overloadable))
+ asinpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asinpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asinpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asinpi(float4 v);
+
+/*
+ * atan: Inverse tangent
+ *
+ * Returns the inverse tangent, in radians.
+ *
+ * See also native_atan().
+ */
+extern float __attribute__((const, overloadable))
+ atan(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atan(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atan(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atan(float4 v);
+
+/*
+ * atan2: Inverse tangent of a ratio
+ *
+ * Returns the inverse tangent of (numerator / denominator), in radians.
+ *
+ * See also native_atan2().
+ *
+ * Parameters:
+ * numerator The numerator
+ * denominator The denominator. Can be 0.
+ */
+extern float __attribute__((const, overloadable))
+ atan2(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ atan2(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ atan2(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ atan2(float4 numerator, float4 denominator);
+
+/*
+ * atan2pi: Inverse tangent of a ratio, divided by pi
+ *
+ * Returns the inverse tangent of (numerator / denominator), in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
+ *
+ * See also native_atan2pi().
+ *
+ * Parameters:
+ * numerator The numerator
+ * denominator The denominator. Can be 0.
+ */
+extern float __attribute__((const, overloadable))
+ atan2pi(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ atan2pi(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ atan2pi(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ atan2pi(float4 numerator, float4 denominator);
+
+/*
+ * atanh: Inverse hyperbolic tangent
+ *
+ * Returns the inverse hyperbolic tangent, in radians.
+ *
+ * See also native_atanh().
+ */
+extern float __attribute__((const, overloadable))
+ atanh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atanh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atanh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atanh(float4 v);
+
+/*
+ * atanpi: Inverse tangent divided by pi
+ *
+ * Returns the inverse tangent in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
+ *
+ * See also native_atanpi().
+ */
+extern float __attribute__((const, overloadable))
+ atanpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atanpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atanpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atanpi(float4 v);
+
+/*
+ * cbrt: Cube root
+ *
+ * Returns the cube root.
+ *
+ * See also native_cbrt().
+ */
+extern float __attribute__((const, overloadable))
+ cbrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cbrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cbrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cbrt(float4 v);
+
+/*
+ * ceil: Smallest integer not less than a value
+ *
+ * Returns the smallest integer not less than a value.
+ *
+ * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
+ *
+ * See also floor().
+ */
+extern float __attribute__((const, overloadable))
+ ceil(float v);
+
+extern float2 __attribute__((const, overloadable))
+ ceil(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ ceil(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ ceil(float4 v);
+
+/*
+ * clamp: Restrain a value to a range
+ *
+ * Clamps a value to a specified high and low bound. clamp() returns min_value
+ * if value < min_value, max_value if value > max_value, otherwise value.
+ *
+ * There are two variants of clamp: one where the min and max are scalars applied
+ * to all entries of the value, the other where the min and max are also vectors.
+ *
+ * If min_value is greater than max_value, the results are undefined.
+ *
+ * Parameters:
+ * value Value to be clamped.
+ * min_value Lower bound, a scalar or matching vector.
+ * max_value High bound, must match the type of low.
+ */
+extern float __attribute__((const, overloadable))
+ clamp(float value, float min_value, float max_value);
+
+extern float2 __attribute__((const, overloadable))
+ clamp(float2 value, float2 min_value, float2 max_value);
+
+extern float3 __attribute__((const, overloadable))
+ clamp(float3 value, float3 min_value, float3 max_value);
+
+extern float4 __attribute__((const, overloadable))
+ clamp(float4 value, float4 min_value, float4 max_value);
+
+extern float2 __attribute__((const, overloadable))
+ clamp(float2 value, float min_value, float max_value);
+
+extern float3 __attribute__((const, overloadable))
+ clamp(float3 value, float min_value, float max_value);
+
+extern float4 __attribute__((const, overloadable))
+ clamp(float4 value, float min_value, float max_value);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char __attribute__((const, overloadable))
+ clamp(char value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char2 __attribute__((const, overloadable))
+ clamp(char2 value, char2 min_value, char2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char3 __attribute__((const, overloadable))
+ clamp(char3 value, char3 min_value, char3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char4 __attribute__((const, overloadable))
+ clamp(char4 value, char4 min_value, char4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar __attribute__((const, overloadable))
+ clamp(uchar value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar2 __attribute__((const, overloadable))
+ clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar3 __attribute__((const, overloadable))
+ clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar4 __attribute__((const, overloadable))
+ clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short __attribute__((const, overloadable))
+ clamp(short value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short2 __attribute__((const, overloadable))
+ clamp(short2 value, short2 min_value, short2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short3 __attribute__((const, overloadable))
+ clamp(short3 value, short3 min_value, short3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short4 __attribute__((const, overloadable))
+ clamp(short4 value, short4 min_value, short4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort __attribute__((const, overloadable))
+ clamp(ushort value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort2 __attribute__((const, overloadable))
+ clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort3 __attribute__((const, overloadable))
+ clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort4 __attribute__((const, overloadable))
+ clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int __attribute__((const, overloadable))
+ clamp(int value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int2 __attribute__((const, overloadable))
+ clamp(int2 value, int2 min_value, int2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int3 __attribute__((const, overloadable))
+ clamp(int3 value, int3 min_value, int3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int4 __attribute__((const, overloadable))
+ clamp(int4 value, int4 min_value, int4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint __attribute__((const, overloadable))
+ clamp(uint value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint2 __attribute__((const, overloadable))
+ clamp(uint2 value, uint2 min_value, uint2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint3 __attribute__((const, overloadable))
+ clamp(uint3 value, uint3 min_value, uint3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint4 __attribute__((const, overloadable))
+ clamp(uint4 value, uint4 min_value, uint4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long __attribute__((const, overloadable))
+ clamp(long value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long2 __attribute__((const, overloadable))
+ clamp(long2 value, long2 min_value, long2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long3 __attribute__((const, overloadable))
+ clamp(long3 value, long3 min_value, long3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long4 __attribute__((const, overloadable))
+ clamp(long4 value, long4 min_value, long4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong __attribute__((const, overloadable))
+ clamp(ulong value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong2 __attribute__((const, overloadable))
+ clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong3 __attribute__((const, overloadable))
+ clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong4 __attribute__((const, overloadable))
+ clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char2 __attribute__((const, overloadable))
+ clamp(char2 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char3 __attribute__((const, overloadable))
+ clamp(char3 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char4 __attribute__((const, overloadable))
+ clamp(char4 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar2 __attribute__((const, overloadable))
+ clamp(uchar2 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar3 __attribute__((const, overloadable))
+ clamp(uchar3 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar4 __attribute__((const, overloadable))
+ clamp(uchar4 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short2 __attribute__((const, overloadable))
+ clamp(short2 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short3 __attribute__((const, overloadable))
+ clamp(short3 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short4 __attribute__((const, overloadable))
+ clamp(short4 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort2 __attribute__((const, overloadable))
+ clamp(ushort2 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort3 __attribute__((const, overloadable))
+ clamp(ushort3 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort4 __attribute__((const, overloadable))
+ clamp(ushort4 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int2 __attribute__((const, overloadable))
+ clamp(int2 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int3 __attribute__((const, overloadable))
+ clamp(int3 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int4 __attribute__((const, overloadable))
+ clamp(int4 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint2 __attribute__((const, overloadable))
+ clamp(uint2 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint3 __attribute__((const, overloadable))
+ clamp(uint3 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint4 __attribute__((const, overloadable))
+ clamp(uint4 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long2 __attribute__((const, overloadable))
+ clamp(long2 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long3 __attribute__((const, overloadable))
+ clamp(long3 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long4 __attribute__((const, overloadable))
+ clamp(long4 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong2 __attribute__((const, overloadable))
+ clamp(ulong2 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong3 __attribute__((const, overloadable))
+ clamp(ulong3 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong4 __attribute__((const, overloadable))
+ clamp(ulong4 value, ulong min_value, ulong max_value);
+#endif
+
+/*
+ * clz: Number of leading 0 bits
+ *
+ * Returns the number of leading 0-bits in a value.
+ *
+ * For example, clz((char)0x03) returns 6.
+ */
+extern char __attribute__((const, overloadable))
+ clz(char value);
+
+extern char2 __attribute__((const, overloadable))
+ clz(char2 value);
+
+extern char3 __attribute__((const, overloadable))
+ clz(char3 value);
+
+extern char4 __attribute__((const, overloadable))
+ clz(char4 value);
+
+extern uchar __attribute__((const, overloadable))
+ clz(uchar value);
+
+extern uchar2 __attribute__((const, overloadable))
+ clz(uchar2 value);
+
+extern uchar3 __attribute__((const, overloadable))
+ clz(uchar3 value);
+
+extern uchar4 __attribute__((const, overloadable))
+ clz(uchar4 value);
+
+extern short __attribute__((const, overloadable))
+ clz(short value);
+
+extern short2 __attribute__((const, overloadable))
+ clz(short2 value);
+
+extern short3 __attribute__((const, overloadable))
+ clz(short3 value);
+
+extern short4 __attribute__((const, overloadable))
+ clz(short4 value);
+
+extern ushort __attribute__((const, overloadable))
+ clz(ushort value);
+
+extern ushort2 __attribute__((const, overloadable))
+ clz(ushort2 value);
+
+extern ushort3 __attribute__((const, overloadable))
+ clz(ushort3 value);
+
+extern ushort4 __attribute__((const, overloadable))
+ clz(ushort4 value);
+
+extern int __attribute__((const, overloadable))
+ clz(int value);
+
+extern int2 __attribute__((const, overloadable))
+ clz(int2 value);
+
+extern int3 __attribute__((const, overloadable))
+ clz(int3 value);
+
+extern int4 __attribute__((const, overloadable))
+ clz(int4 value);
+
+extern uint __attribute__((const, overloadable))
+ clz(uint value);
+
+extern uint2 __attribute__((const, overloadable))
+ clz(uint2 value);
+
+extern uint3 __attribute__((const, overloadable))
+ clz(uint3 value);
+
+extern uint4 __attribute__((const, overloadable))
+ clz(uint4 value);
+
+/*
+ * copysign: Copies the sign of a number to another
+ *
+ * Copies the sign from sign_value to magnitude_value.
+ *
+ * The value returned is either magnitude_value or -magnitude_value.
+ *
+ * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
+ */
+extern float __attribute__((const, overloadable))
+ copysign(float magnitude_value, float sign_value);
+
+extern float2 __attribute__((const, overloadable))
+ copysign(float2 magnitude_value, float2 sign_value);
+
+extern float3 __attribute__((const, overloadable))
+ copysign(float3 magnitude_value, float3 sign_value);
+
+extern float4 __attribute__((const, overloadable))
+ copysign(float4 magnitude_value, float4 sign_value);
+
+/*
+ * cos: Cosine
+ *
+ * Returns the cosine of an angle measured in radians.
+ *
+ * See also native_cos().
+ */
+extern float __attribute__((const, overloadable))
+ cos(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cos(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cos(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cos(float4 v);
+
+/*
+ * cosh: Hypebolic cosine
+ *
+ * Returns the hypebolic cosine of v, where v is measured in radians.
+ *
+ * See also native_cosh().
+ */
+extern float __attribute__((const, overloadable))
+ cosh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cosh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cosh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cosh(float4 v);
+
+/*
+ * cospi: Cosine of a number multiplied by pi
+ *
+ * Returns the cosine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
+ *
+ * See also native_cospi().
+ */
+extern float __attribute__((const, overloadable))
+ cospi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cospi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cospi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cospi(float4 v);
+
+/*
+ * degrees: Converts radians into degrees
+ *
+ * Converts from radians to degrees.
+ */
+extern float __attribute__((const, overloadable))
+ degrees(float v);
+
+extern float2 __attribute__((const, overloadable))
+ degrees(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ degrees(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ degrees(float4 v);
+
+/*
+ * erf: Mathematical error function
+ *
+ * Returns the error function.
+ */
+extern float __attribute__((const, overloadable))
+ erf(float v);
+
+extern float2 __attribute__((const, overloadable))
+ erf(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ erf(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ erf(float4 v);
+
+/*
+ * erfc: Mathematical complementary error function
+ *
+ * Returns the complementary error function.
+ */
+extern float __attribute__((const, overloadable))
+ erfc(float v);
+
+extern float2 __attribute__((const, overloadable))
+ erfc(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ erfc(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ erfc(float4 v);
+
+/*
+ * exp: e raised to a number
+ *
+ * Returns e raised to v, i.e. e ^ v.
+ *
+ * See also native_exp().
+ */
+extern float __attribute__((const, overloadable))
+ exp(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp(float4 v);
+
+/*
+ * exp10: 10 raised to a number
+ *
+ * Returns 10 raised to v, i.e. 10.f ^ v.
+ *
+ * See also native_exp10().
+ */
+extern float __attribute__((const, overloadable))
+ exp10(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp10(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp10(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp10(float4 v);
+
+/*
+ * exp2: 2 raised to a number
+ *
+ * Returns 2 raised to v, i.e. 2.f ^ v.
+ *
+ * See also native_exp2().
+ */
+extern float __attribute__((const, overloadable))
+ exp2(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp2(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp2(float4 v);
+
+/*
+ * expm1: e raised to a number minus one
+ *
+ * Returns e raised to v minus 1, i.e. (e ^ v) - 1.
+ *
+ * See also native_expm1().
+ */
+extern float __attribute__((const, overloadable))
+ expm1(float v);
+
+extern float2 __attribute__((const, overloadable))
+ expm1(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ expm1(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ expm1(float4 v);
+
+/*
+ * fabs: Absolute value of a float
+ *
+ * Returns the absolute value of the float v.
+ *
+ * For integers, use abs().
+ */
+extern float __attribute__((const, overloadable))
+ fabs(float v);
+
+extern float2 __attribute__((const, overloadable))
+ fabs(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ fabs(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ fabs(float4 v);
+
+/*
+ * fdim: Positive difference between two values
+ *
+ * Returns the positive difference between two values.
+ *
+ * If a > b, returns (a - b) otherwise returns 0f.
+ */
+extern float __attribute__((const, overloadable))
+ fdim(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fdim(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fdim(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fdim(float4 a, float4 b);
+
+/*
+ * floor: Smallest integer not greater than a value
+ *
+ * Returns the smallest integer not greater than a value.
+ *
+ * For example, floor(1.2f) returns 1.f, and floor(-1.2f) returns -2.f.
+ *
+ * See also ceil().
+ */
+extern float __attribute__((const, overloadable))
+ floor(float v);
+
+extern float2 __attribute__((const, overloadable))
+ floor(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ floor(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ floor(float4 v);
+
+/*
+ * fma: Multiply and add
+ *
+ * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
+ *
+ * This function is similar to mad(). fma() retains full precision of the
+ * multiplied result and rounds only after the addition. mad() rounds after the
+ * multiplication and the addition. This extra precision is not guaranteed in
+ * rs_fp_relaxed mode.
+ */
+extern float __attribute__((const, overloadable))
+ fma(float multiplicand1, float multiplicand2, float offset);
+
+extern float2 __attribute__((const, overloadable))
+ fma(float2 multiplicand1, float2 multiplicand2, float2 offset);
+
+extern float3 __attribute__((const, overloadable))
+ fma(float3 multiplicand1, float3 multiplicand2, float3 offset);
+
+extern float4 __attribute__((const, overloadable))
+ fma(float4 multiplicand1, float4 multiplicand2, float4 offset);
+
+/*
+ * fmax: Maximum of two floats
+ *
+ * Returns the maximum of a and b, i.e. (a < b ? b : a).
+ *
+ * The max() function returns identical results but can be applied to more data types.
+ */
+extern float __attribute__((const, overloadable))
+ fmax(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fmax(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fmax(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fmax(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ fmax(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ fmax(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ fmax(float4 a, float b);
+
+/*
+ * fmin: Minimum of two floats
+ *
+ * Returns the minimum of a and b, i.e. (a > b ? b : a).
+ *
+ * The min() function returns identical results but can be applied to more data types.
+ */
+extern float __attribute__((const, overloadable))
+ fmin(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fmin(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fmin(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fmin(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ fmin(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ fmin(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ fmin(float4 a, float b);
+
+/*
+ * fmod: Modulo
+ *
+ * Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
+ *
+ * The function remainder() is similar but rounds toward the closest interger.
+ * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
+ * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
+ */
+extern float __attribute__((const, overloadable))
+ fmod(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ fmod(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ fmod(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ fmod(float4 numerator, float4 denominator);
+
+/*
+ * fract: Positive fractional part
+ *
+ * Returns the positive fractional part of v, i.e. v - floor(v).
+ *
+ * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
+ * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
+ *
+ * Parameters:
+ * v Input value.
+ * floor If floor is not null, *floor will be set to the floor of v.
+ */
+extern float __attribute__((overloadable))
+ fract(float v, float* floor);
+
+extern float2 __attribute__((overloadable))
+ fract(float2 v, float2* floor);
+
+extern float3 __attribute__((overloadable))
+ fract(float3 v, float3* floor);
+
+extern float4 __attribute__((overloadable))
+ fract(float4 v, float4* floor);
+
+static inline float __attribute__((const, overloadable))
+ fract(float v) {
+ float unused;
+ return fract(v, &unused);
+}
+
+static inline float2 __attribute__((const, overloadable))
+ fract(float2 v) {
+ float2 unused;
+ return fract(v, &unused);
+}
+
+static inline float3 __attribute__((const, overloadable))
+ fract(float3 v) {
+ float3 unused;
+ return fract(v, &unused);
+}
+
+static inline float4 __attribute__((const, overloadable))
+ fract(float4 v) {
+ float4 unused;
+ return fract(v, &unused);
+}
+
+/*
+ * frexp: Binary mantissa and exponent
+ *
+ * Returns the binary mantissa and exponent of v, i.e. v == mantissa * 2 ^ exponent.
+ *
+ * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
+ *
+ * See ldexp() for the reverse operation. See also logb() and ilogb().
+ *
+ * Parameters:
+ * v Input value.
+ * exponent If exponent is not null, *exponent will be set to the exponent of v.
+ */
+extern float __attribute__((overloadable))
+ frexp(float v, int* exponent);
+
+extern float2 __attribute__((overloadable))
+ frexp(float2 v, int2* exponent);
+
+extern float3 __attribute__((overloadable))
+ frexp(float3 v, int3* exponent);
+
+extern float4 __attribute__((overloadable))
+ frexp(float4 v, int4* exponent);
+
+/*
+ * half_recip: Reciprocal computed to 16 bit precision
+ *
+ * Returns the approximate reciprocal of a value.
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also native_recip().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_recip(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_recip(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_recip(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_recip(float4 v);
+#endif
+
+/*
+ * half_rsqrt: Reciprocal of a square root computed to 16 bit precision
+ *
+ * Returns the approximate value of (1.f / sqrt(value)).
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also rsqrt(), native_rsqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_rsqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_rsqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_rsqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_rsqrt(float4 v);
+#endif
+
+/*
+ * half_sqrt: Square root computed to 16 bit precision
+ *
+ * Returns the approximate square root of a value.
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also sqrt(), native_sqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_sqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_sqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_sqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_sqrt(float4 v);
+#endif
+
+/*
+ * hypot: Hypotenuse
+ *
+ * Returns the hypotenuse, i.e. sqrt(a * a + b * b).
+ *
+ * See also native_hypot().
+ */
+extern float __attribute__((const, overloadable))
+ hypot(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ hypot(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ hypot(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ hypot(float4 a, float4 b);
+
+/*
+ * ilogb: Base two exponent
+ *
+ * Returns the base two exponent of a value, where the mantissa is between
+ * 1.f (inclusive) and 2.f (exclusive).
+ *
+ * For example, ilogb(8.5f) returns 3.
+ *
+ * Because of the difference in mantissa, this number is one less than
+ * is returned by frexp().
+ *
+ * logb() is similar but returns a float.
+ */
+extern int __attribute__((const, overloadable))
+ ilogb(float v);
+
+extern int2 __attribute__((const, overloadable))
+ ilogb(float2 v);
+
+extern int3 __attribute__((const, overloadable))
+ ilogb(float3 v);
+
+extern int4 __attribute__((const, overloadable))
+ ilogb(float4 v);
+
+/*
+ * ldexp: Creates a floating point from mantissa and exponent
+ *
+ * Returns the floating point created from the mantissa and exponent,
+ * i.e. (mantissa * 2 ^ exponent).
+ *
+ * See frexp() for the reverse operation.
+ *
+ * Parameters:
+ * mantissa The mantissa
+ * exponent The exponent, a single component or matching vector.
+ */
+extern float __attribute__((const, overloadable))
+ ldexp(float mantissa, int exponent);
+
+extern float2 __attribute__((const, overloadable))
+ ldexp(float2 mantissa, int2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ ldexp(float3 mantissa, int3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ ldexp(float4 mantissa, int4 exponent);
+
+extern float2 __attribute__((const, overloadable))
+ ldexp(float2 mantissa, int exponent);
+
+extern float3 __attribute__((const, overloadable))
+ ldexp(float3 mantissa, int exponent);
+
+extern float4 __attribute__((const, overloadable))
+ ldexp(float4 mantissa, int exponent);
+
+/*
+ * lgamma: Natural logarithm of the gamma function
+ *
+ * Returns the natural logarithm of the absolute value of the gamma function,
+ * i.e. log(fabs(tgamma(v))).
+ *
+ * See also tgamma().
+ *
+ * Parameters:
+ * sign_of_gamma If sign_of_gamma is not null, *sign_of_gamma will be set to -1.f if the gamma of v is negative, otherwise to 1.f.
+ */
+extern float __attribute__((const, overloadable))
+ lgamma(float v);
+
+extern float2 __attribute__((const, overloadable))
+ lgamma(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ lgamma(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ lgamma(float4 v);
+
+extern float __attribute__((overloadable))
+ lgamma(float v, int* sign_of_gamma);
+
+extern float2 __attribute__((overloadable))
+ lgamma(float2 v, int2* sign_of_gamma);
+
+extern float3 __attribute__((overloadable))
+ lgamma(float3 v, int3* sign_of_gamma);
+
+extern float4 __attribute__((overloadable))
+ lgamma(float4 v, int4* sign_of_gamma);
+
+/*
+ * log: Natural logarithm
+ *
+ * Returns the natural logarithm.
+ *
+ * See also native_log().
+ */
+extern float __attribute__((const, overloadable))
+ log(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log(float4 v);
+
+/*
+ * log10: Base 10 logarithm
+ *
+ * Returns the base 10 logarithm.
+ *
+ * See also native_log10().
+ */
+extern float __attribute__((const, overloadable))
+ log10(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log10(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log10(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log10(float4 v);
+
+/*
+ * log1p: Natural logarithm of a value plus 1
+ *
+ * Returns the natural logarithm of (v + 1.f).
+ *
+ * See also native_log1p().
+ */
+extern float __attribute__((const, overloadable))
+ log1p(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log1p(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log1p(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log1p(float4 v);
+
+/*
+ * log2: Base 2 logarithm
+ *
+ * Returns the base 2 logarithm.
+ *
+ * See also native_log2().
+ */
+extern float __attribute__((const, overloadable))
+ log2(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log2(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log2(float4 v);
+
+/*
+ * logb: Base two exponent
+ *
+ * Returns the base two exponent of a value, where the mantissa is between
+ * 1.f (inclusive) and 2.f (exclusive).
+ *
+ * For example, logb(8.5f) returns 3.f.
+ *
+ * Because of the difference in mantissa, this number is one less than
+ * is returned by frexp().
+ *
+ * ilogb() is similar but returns an integer.
+ */
+extern float __attribute__((const, overloadable))
+ logb(float v);
+
+extern float2 __attribute__((const, overloadable))
+ logb(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ logb(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ logb(float4 v);
+
+/*
+ * mad: Multiply and add
+ *
+ * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
+ *
+ * This function is similar to fma(). fma() retains full precision of the
+ * multiplied result and rounds only after the addition. mad() rounds after the
+ * multiplication and the addition. In rs_fp_relaxed mode, mad() may not do the
+ * rounding after multiplicaiton.
+ */
+extern float __attribute__((const, overloadable))
+ mad(float multiplicand1, float multiplicand2, float offset);
+
+extern float2 __attribute__((const, overloadable))
+ mad(float2 multiplicand1, float2 multiplicand2, float2 offset);
+
+extern float3 __attribute__((const, overloadable))
+ mad(float3 multiplicand1, float3 multiplicand2, float3 offset);
+
+extern float4 __attribute__((const, overloadable))
+ mad(float4 multiplicand1, float4 multiplicand2, float4 offset);
+
+/*
+ * max: Maximum
+ *
+ * Returns the maximum value of two arguments.
+ */
+extern float __attribute__((const, overloadable))
+ max(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ max(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ max(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ max(float4 a, float4 b);
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char __attribute__((const, overloadable))
+ max(char a, char b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar __attribute__((const, overloadable))
+ max(uchar a, uchar b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short __attribute__((const, overloadable))
+ max(short a, short b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort __attribute__((const, overloadable))
+ max(ushort a, ushort b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int __attribute__((const, overloadable))
+ max(int a, int b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint __attribute__((const, overloadable))
+ max(uint a, uint b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char2 __attribute__((const, overloadable))
+ max(char2 a, char2 b) {
+ char2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar2 __attribute__((const, overloadable))
+ max(uchar2 a, uchar2 b) {
+ uchar2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short2 __attribute__((const, overloadable))
+ max(short2 a, short2 b) {
+ short2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort2 __attribute__((const, overloadable))
+ max(ushort2 a, ushort2 b) {
+ ushort2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int2 __attribute__((const, overloadable))
+ max(int2 a, int2 b) {
+ int2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint2 __attribute__((const, overloadable))
+ max(uint2 a, uint2 b) {
+ uint2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char3 __attribute__((const, overloadable))
+ max(char3 a, char3 b) {
+ char3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar3 __attribute__((const, overloadable))
+ max(uchar3 a, uchar3 b) {
+ uchar3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short3 __attribute__((const, overloadable))
+ max(short3 a, short3 b) {
+ short3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort3 __attribute__((const, overloadable))
+ max(ushort3 a, ushort3 b) {
+ ushort3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int3 __attribute__((const, overloadable))
+ max(int3 a, int3 b) {
+ int3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint3 __attribute__((const, overloadable))
+ max(uint3 a, uint3 b) {
+ uint3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char4 __attribute__((const, overloadable))
+ max(char4 a, char4 b) {
+ char4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar4 __attribute__((const, overloadable))
+ max(uchar4 a, uchar4 b) {
+ uchar4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short4 __attribute__((const, overloadable))
+ max(short4 a, short4 b) {
+ short4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort4 __attribute__((const, overloadable))
+ max(ushort4 a, ushort4 b) {
+ ushort4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int4 __attribute__((const, overloadable))
+ max(int4 a, int4 b) {
+ int4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint4 __attribute__((const, overloadable))
+ max(uint4 a, uint4 b) {
+ uint4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char __attribute__((const, overloadable))
+ max(char a, char b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ max(char2 a, char2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ max(char3 a, char3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ max(char4 a, char4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar __attribute__((const, overloadable))
+ max(uchar a, uchar b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ max(uchar2 a, uchar2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ max(uchar3 a, uchar3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ max(uchar4 a, uchar4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short __attribute__((const, overloadable))
+ max(short a, short b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ max(short2 a, short2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ max(short3 a, short3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ max(short4 a, short4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort __attribute__((const, overloadable))
+ max(ushort a, ushort b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ max(ushort2 a, ushort2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ max(ushort3 a, ushort3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ max(ushort4 a, ushort4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int __attribute__((const, overloadable))
+ max(int a, int b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ max(int2 a, int2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ max(int3 a, int3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ max(int4 a, int4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint __attribute__((const, overloadable))
+ max(uint a, uint b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ max(uint2 a, uint2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ max(uint3 a, uint3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ max(uint4 a, uint4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long __attribute__((const, overloadable))
+ max(long a, long b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ max(long2 a, long2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ max(long3 a, long3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ max(long4 a, long4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong __attribute__((const, overloadable))
+ max(ulong a, ulong b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ max(ulong2 a, ulong2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ max(ulong3 a, ulong3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ max(ulong4 a, ulong4 b);
+#endif
+
+/*
+ * min: Minimum
+ *
+ * Returns the minimum value of two arguments.
+ */
+extern float __attribute__((const, overloadable))
+ min(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ min(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ min(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ min(float4 a, float4 b);
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char __attribute__((const, overloadable))
+ min(char a, char b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar __attribute__((const, overloadable))
+ min(uchar a, uchar b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short __attribute__((const, overloadable))
+ min(short a, short b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort __attribute__((const, overloadable))
+ min(ushort a, ushort b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int __attribute__((const, overloadable))
+ min(int a, int b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint __attribute__((const, overloadable))
+ min(uint a, uint b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char2 __attribute__((const, overloadable))
+ min(char2 a, char2 b) {
+ char2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar2 __attribute__((const, overloadable))
+ min(uchar2 a, uchar2 b) {
+ uchar2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short2 __attribute__((const, overloadable))
+ min(short2 a, short2 b) {
+ short2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort2 __attribute__((const, overloadable))
+ min(ushort2 a, ushort2 b) {
+ ushort2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int2 __attribute__((const, overloadable))
+ min(int2 a, int2 b) {
+ int2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint2 __attribute__((const, overloadable))
+ min(uint2 a, uint2 b) {
+ uint2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char3 __attribute__((const, overloadable))
+ min(char3 a, char3 b) {
+ char3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar3 __attribute__((const, overloadable))
+ min(uchar3 a, uchar3 b) {
+ uchar3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short3 __attribute__((const, overloadable))
+ min(short3 a, short3 b) {
+ short3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort3 __attribute__((const, overloadable))
+ min(ushort3 a, ushort3 b) {
+ ushort3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int3 __attribute__((const, overloadable))
+ min(int3 a, int3 b) {
+ int3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint3 __attribute__((const, overloadable))
+ min(uint3 a, uint3 b) {
+ uint3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char4 __attribute__((const, overloadable))
+ min(char4 a, char4 b) {
+ char4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar4 __attribute__((const, overloadable))
+ min(uchar4 a, uchar4 b) {
+ uchar4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short4 __attribute__((const, overloadable))
+ min(short4 a, short4 b) {
+ short4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort4 __attribute__((const, overloadable))
+ min(ushort4 a, ushort4 b) {
+ ushort4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int4 __attribute__((const, overloadable))
+ min(int4 a, int4 b) {
+ int4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint4 __attribute__((const, overloadable))
+ min(uint4 a, uint4 b) {
+ uint4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char __attribute__((const, overloadable))
+ min(char a, char b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ min(char2 a, char2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ min(char3 a, char3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ min(char4 a, char4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar __attribute__((const, overloadable))
+ min(uchar a, uchar b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ min(uchar2 a, uchar2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ min(uchar3 a, uchar3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ min(uchar4 a, uchar4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short __attribute__((const, overloadable))
+ min(short a, short b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ min(short2 a, short2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ min(short3 a, short3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ min(short4 a, short4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort __attribute__((const, overloadable))
+ min(ushort a, ushort b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ min(ushort2 a, ushort2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ min(ushort3 a, ushort3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ min(ushort4 a, ushort4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int __attribute__((const, overloadable))
+ min(int a, int b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ min(int2 a, int2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ min(int3 a, int3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ min(int4 a, int4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint __attribute__((const, overloadable))
+ min(uint a, uint b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ min(uint2 a, uint2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ min(uint3 a, uint3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ min(uint4 a, uint4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long __attribute__((const, overloadable))
+ min(long a, long b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ min(long2 a, long2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ min(long3 a, long3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ min(long4 a, long4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong __attribute__((const, overloadable))
+ min(ulong a, ulong b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ min(ulong2 a, ulong2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ min(ulong3 a, ulong3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ min(ulong4 a, ulong4 b);
+#endif
+
+/*
+ * mix: Mixes two values
+ *
+ * Returns start + ((stop - start) * fraction).
+ *
+ * This can be useful for mixing two values. For example, to create a new color that is 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
+ */
+extern float __attribute__((const, overloadable))
+ mix(float start, float stop, float fraction);
+
+extern float2 __attribute__((const, overloadable))
+ mix(float2 start, float2 stop, float2 fraction);
+
+extern float3 __attribute__((const, overloadable))
+ mix(float3 start, float3 stop, float3 fraction);
+
+extern float4 __attribute__((const, overloadable))
+ mix(float4 start, float4 stop, float4 fraction);
+
+extern float2 __attribute__((const, overloadable))
+ mix(float2 start, float2 stop, float fraction);
+
+extern float3 __attribute__((const, overloadable))
+ mix(float3 start, float3 stop, float fraction);
+
+extern float4 __attribute__((const, overloadable))
+ mix(float4 start, float4 stop, float fraction);
+
+/*
+ * modf: Integral and fractional components
+ *
+ * Returns the integral and fractional components of a number.
+ *
+ * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
+ *
+ * Parameters:
+ * v Source value
+ * integral_part *integral_part will be set to the integral portion of the number.
+ *
+ * Returns: The floating point portion of the value.
+ */
+extern float __attribute__((overloadable))
+ modf(float v, float* integral_part);
+
+extern float2 __attribute__((overloadable))
+ modf(float2 v, float2* integral_part);
+
+extern float3 __attribute__((overloadable))
+ modf(float3 v, float3* integral_part);
+
+extern float4 __attribute__((overloadable))
+ modf(float4 v, float4* integral_part);
+
+/*
+ * nan: Not a Number
+ *
+ * Returns a NaN value (Not a Number).
+ *
+ * Parameters:
+ * v Not used.
+ */
+extern float __attribute__((const, overloadable))
+ nan(uint v);
+
+/*
+ * native_acos: Approximate inverse cosine
+ *
+ * Returns the approximate inverse cosine, in radians.
+ *
+ * This function yields undefined results from input values less than -1 or greater
+ * than 1.
+ *
+ * See also acos().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acos(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acos(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acos(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acos(float4 v);
+#endif
+
+/*
+ * native_acosh: Approximate inverse hyperbolic cosine
+ *
+ * Returns the approximate inverse hyperbolic cosine, in radians.
+ *
+ * See also acosh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acosh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acosh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acosh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acosh(float4 v);
+#endif
+
+/*
+ * native_acospi: Approximate inverse cosine divided by pi
+ *
+ * Returns the approximate inverse cosine in radians, divided by pi.
+ *
+ * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
+ *
+ * This function yields undefined results from input values less than -1 or greater
+ * than 1.
+ *
+ * See also acospi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acospi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acospi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acospi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acospi(float4 v);
+#endif
+
+/*
+ * native_asin: Approximate inverse sine
+ *
+ * Returns the approximate inverse sine, in radians.
+ *
+ * This function yields undefined results from input values less than -1 or greater
+ * than 1.
+ *
+ * See also asin().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asin(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asin(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asin(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asin(float4 v);
+#endif
+
+/*
+ * native_asinh: Approximate inverse hyperbolic sine
+ *
+ * Returns the approximate inverse hyperbolic sine, in radians.
+ *
+ * See also asinh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asinh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asinh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asinh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asinh(float4 v);
+#endif
+
+/*
+ * native_asinpi: Approximate inverse sine divided by pi
+ *
+ * Returns the approximate inverse sine in radians, divided by pi.
+ *
+ * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
+ *
+ * This function yields undefined results from input values less than -1 or greater
+ * than 1.
+ *
+ * See also asinpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asinpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asinpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asinpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asinpi(float4 v);
+#endif
+
+/*
+ * native_atan: Approximate inverse tangent
+ *
+ * Returns the approximate inverse tangent, in radians.
+ *
+ * See also atan().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan(float4 v);
+#endif
+
+/*
+ * native_atan2: Approximate inverse tangent of a ratio
+ *
+ * Returns the approximate inverse tangent of (numerator / denominator), in radians.
+ *
+ * See also atan2().
+ *
+ * Parameters:
+ * numerator The numerator
+ * denominator The denominator. Can be 0.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan2(float numerator, float denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan2(float2 numerator, float2 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan2(float3 numerator, float3 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan2(float4 numerator, float4 denominator);
+#endif
+
+/*
+ * native_atan2pi: Approximate inverse tangent of a ratio, divided by pi
+ *
+ * Returns the approximate inverse tangent of (numerator / denominator), in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
+ *
+ * See also atan2pi().
+ *
+ * Parameters:
+ * numerator The numerator
+ * denominator The denominator. Can be 0.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan2pi(float numerator, float denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan2pi(float2 numerator, float2 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan2pi(float3 numerator, float3 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan2pi(float4 numerator, float4 denominator);
+#endif
+
+/*
+ * native_atanh: Approximate inverse hyperbolic tangent
+ *
+ * Returns the approximate inverse hyperbolic tangent, in radians.
+ *
+ * See also atanh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atanh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atanh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atanh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atanh(float4 v);
+#endif
+
+/*
+ * native_atanpi: Approximate inverse tangent divided by pi
+ *
+ * Returns the approximate inverse tangent in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
+ *
+ * See also atanpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atanpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atanpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atanpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atanpi(float4 v);
+#endif
+
+/*
+ * native_cbrt: Approximate cube root
+ *
+ * Returns the approximate cubic root.
+ *
+ * See also cbrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cbrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cbrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cbrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cbrt(float4 v);
+#endif
+
+/*
+ * native_cos: Approximate cosine
+ *
+ * Returns the approximate cosine of an angle measured in radians.
+ *
+ * See also cos().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cos(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cos(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cos(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cos(float4 v);
+#endif
+
+/*
+ * native_cosh: Approximate hypebolic cosine
+ *
+ * Returns the approximate hypebolic cosine.
+ *
+ * See also cosh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cosh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cosh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cosh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cosh(float4 v);
+#endif
+
+/*
+ * native_cospi: Approximate cosine of a number multiplied by pi
+ *
+ * Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
+ *
+ * See also cospi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cospi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cospi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cospi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cospi(float4 v);
+#endif
+
+/*
+ * native_divide: Approximate division
+ *
+ * Computes the approximate division of two values.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_divide(float left_vector, float right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_divide(float2 left_vector, float2 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_divide(float3 left_vector, float3 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_divide(float4 left_vector, float4 right_vector);
+#endif
+
+/*
+ * native_exp: Approximate e raised to a number
+ *
+ * Fast approximate exp.
+ *
+ * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
+ *
+ * See also exp().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp(float4 v);
+#endif
+
+/*
+ * native_exp10: Approximate 10 raised to a number
+ *
+ * Fast approximate exp10.
+ *
+ * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
+ *
+ * See also exp10().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp10(float4 v);
+#endif
+
+/*
+ * native_exp2: Approximate 2 raised to a number
+ *
+ * Fast approximate exp2.
+ *
+ * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
+ *
+ * See also exp2().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp2(float4 v);
+#endif
+
+/*
+ * native_expm1: Approximate e raised to a number minus one
+ *
+ * Returns the approximate (e ^ v) - 1.
+ *
+ * See also expm1().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_expm1(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_expm1(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_expm1(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_expm1(float4 v);
+#endif
+
+/*
+ * native_hypot: Approximate hypotenuse
+ *
+ * Returns the approximate native_sqrt(a * a + b * b)
+ *
+ * See also hypot().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_hypot(float a, float b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_hypot(float2 a, float2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_hypot(float3 a, float3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_hypot(float4 a, float4 b);
+#endif
+
+/*
+ * native_log: Approximate natural logarithm
+ *
+ * Fast approximate log.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log(float4 v);
+#endif
+
+/*
+ * native_log10: Approximate base 10 logarithm
+ *
+ * Fast approximate log10.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log10().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log10(float4 v);
+#endif
+
+/*
+ * native_log1p: Approximate natural logarithm of a value plus 1
+ *
+ * Returns the approximate natural logarithm of (v + 1.0f)
+ *
+ * See also log1p().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_log1p(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_log1p(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_log1p(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_log1p(float4 v);
+#endif
+
+/*
+ * native_log2: Approximate base 2 logarithm
+ *
+ * Fast approximate log2.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log2().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log2(float4 v);
+#endif
+
+/*
+ * native_powr: Approximate positive base raised to an exponent
+ *
+ * Fast approximate (base ^ exponent).
+ *
+ * See also powr().
+ *
+ * Parameters:
+ * base Must be between 0.f and 256.f. The function is not accurate for values very close to zero.
+ * exponent Must be between -15.f and 15.f.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_powr(float base, float exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_powr(float2 base, float2 exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_powr(float3 base, float3 exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_powr(float4 base, float4 exponent);
+#endif
+
+/*
+ * native_recip: Approximate reciprocal
+ *
+ * Returns the approximate approximate reciprocal of a value.
+ *
+ * See also half_recip().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_recip(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_recip(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_recip(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_recip(float4 v);
+#endif
+
+/*
+ * native_rootn: Approximate nth root
+ *
+ * Compute the approximate Nth root of a value.
+ *
+ * See also rootn().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_rootn(float v, int n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_rootn(float2 v, int2 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_rootn(float3 v, int3 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_rootn(float4 v, int4 n);
+#endif
+
+/*
+ * native_rsqrt: Approximate reciprocal of a square root
+ *
+ * Returns approximate (1 / sqrt(v)).
+ *
+ * See also rsqrt(), half_rsqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_rsqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_rsqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_rsqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_rsqrt(float4 v);
+#endif
+
+/*
+ * native_sin: Approximate sine
+ *
+ * Returns the approximate sine of an angle measured in radians.
+ *
+ * See also sin().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sin(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sin(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sin(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sin(float4 v);
+#endif
+
+/*
+ * native_sincos: Approximate sine and cosine
+ *
+ * Returns the approximate sine and cosine of a value.
+ *
+ * See also sincos().
+ *
+ * Parameters:
+ * v The incoming value in radians.
+ * cos *cos will be set to the cosine value.
+ *
+ * Returns: sine
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((overloadable))
+ native_sincos(float v, float* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((overloadable))
+ native_sincos(float2 v, float2* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((overloadable))
+ native_sincos(float3 v, float3* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((overloadable))
+ native_sincos(float4 v, float4* cos);
+#endif
+
+/*
+ * native_sinh: Approximate hyperbolic sine
+ *
+ * Returns the approximate hyperbolic sine of a value specified in radians.
+ *
+ * See also sinh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sinh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sinh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sinh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sinh(float4 v);
+#endif
+
+/*
+ * native_sinpi: Approximate sine of a number multiplied by pi
+ *
+ * Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
+ *
+ * See also sinpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sinpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sinpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sinpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sinpi(float4 v);
+#endif
+
+/*
+ * native_sqrt: Approximate square root
+ *
+ * Returns the approximate sqrt(v).
+ *
+ * See also sqrt(), half_sqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sqrt(float4 v);
+#endif
+
+/*
+ * native_tan: Approximate tangent
+ *
+ * Returns the approximate tangent of an angle measured in radians.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tan(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tan(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tan(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tan(float4 v);
+#endif
+
+/*
+ * native_tanh: Approximate hyperbolic tangent
+ *
+ * Returns the approximate hyperbolic tangent of a value.
+ *
+ * See also tanh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tanh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tanh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tanh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tanh(float4 v);
+#endif
+
+/*
+ * native_tanpi: Approximate tangent of a number multiplied by pi
+ *
+ * Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
+ *
+ * See also tanpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tanpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tanpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tanpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tanpi(float4 v);
+#endif
+
+/*
+ * nextafter: Next floating point number
+ *
+ * Returns the next representable floating point number from v towards target.
+ *
+ * In rs_fp_relaxed mode, a denormalized input value may not yield the next
+ * denormalized value, as support of denormalized values is optional in
+ * relaxed mode.
+ */
+extern float __attribute__((const, overloadable))
+ nextafter(float v, float target);
+
+extern float2 __attribute__((const, overloadable))
+ nextafter(float2 v, float2 target);
+
+extern float3 __attribute__((const, overloadable))
+ nextafter(float3 v, float3 target);
+
+extern float4 __attribute__((const, overloadable))
+ nextafter(float4 v, float4 target);
+
+/*
+ * pow: Base raised to an exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent.
+ *
+ * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
+ */
+extern float __attribute__((const, overloadable))
+ pow(float base, float exponent);
+
+extern float2 __attribute__((const, overloadable))
+ pow(float2 base, float2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ pow(float3 base, float3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ pow(float4 base, float4 exponent);
+
+/*
+ * pown: Base raised to an integer exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent.
+ *
+ * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
+ */
+extern float __attribute__((const, overloadable))
+ pown(float base, int exponent);
+
+extern float2 __attribute__((const, overloadable))
+ pown(float2 base, int2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ pown(float3 base, int3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ pown(float4 base, int4 exponent);
+
+/*
+ * powr: Positive base raised to an exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent. base must be >= 0.
+ *
+ * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
+ *
+ * See also native_powr().
+ */
+extern float __attribute__((const, overloadable))
+ powr(float base, float exponent);
+
+extern float2 __attribute__((const, overloadable))
+ powr(float2 base, float2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ powr(float3 base, float3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ powr(float4 base, float4 exponent);
+
+/*
+ * radians: Converts degrees into radians
+ *
+ * Converts from degrees to radians.
+ */
+extern float __attribute__((const, overloadable))
+ radians(float v);
+
+extern float2 __attribute__((const, overloadable))
+ radians(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ radians(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ radians(float4 v);
+
+/*
+ * remainder: Remainder of a division
+ *
+ * Returns the remainder of (numerator / denominator), where the quotient is rounded towards the nearest integer.
+ *
+ * The function fmod() is similar but rounds toward the closest interger.
+ * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
+ * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
+ */
+extern float __attribute__((const, overloadable))
+ remainder(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ remainder(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ remainder(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ remainder(float4 numerator, float4 denominator);
+
+/*
+ * remquo: Remainder and quotient of a division
+ *
+ * Returns the quotient and the remainder of (numerator / denominator).
+ *
+ * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
+ *
+ * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
+ *
+ * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
+ *
+ * Parameters:
+ * numerator The numerator.
+ * denominator The denominator.
+ * quotient *quotient will be set to the integer quotient.
+ *
+ * Returns: The remainder, precise only for the low three bits.
+ */
+extern float __attribute__((overloadable))
+ remquo(float numerator, float denominator, int* quotient);
+
+extern float2 __attribute__((overloadable))
+ remquo(float2 numerator, float2 denominator, int2* quotient);
+
+extern float3 __attribute__((overloadable))
+ remquo(float3 numerator, float3 denominator, int3* quotient);
+
+extern float4 __attribute__((overloadable))
+ remquo(float4 numerator, float4 denominator, int4* quotient);
+
+/*
+ * rint: Round to even
+ *
+ * Rounds to the nearest integral value.
+ *
+ * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
+ *
+ * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
+ */
+extern float __attribute__((const, overloadable))
+ rint(float v);
+
+extern float2 __attribute__((const, overloadable))
+ rint(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ rint(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ rint(float4 v);
+
+/*
+ * rootn: Nth root
+ *
+ * Compute the Nth root of a value.
+ *
+ * See also native_rootn().
+ */
+extern float __attribute__((const, overloadable))
+ rootn(float v, int n);
+
+extern float2 __attribute__((const, overloadable))
+ rootn(float2 v, int2 n);
+
+extern float3 __attribute__((const, overloadable))
+ rootn(float3 v, int3 n);
+
+extern float4 __attribute__((const, overloadable))
+ rootn(float4 v, int4 n);
+
+/*
+ * round: Round away from zero
+ *
+ * Round to the nearest integral value.
+ *
+ * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
+ *
+ * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
+ */
+extern float __attribute__((const, overloadable))
+ round(float v);
+
+extern float2 __attribute__((const, overloadable))
+ round(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ round(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ round(float4 v);
+
+/*
+ * rsqrt: Reciprocal of a square root
+ *
+ * Returns (1 / sqrt(v)).
+ *
+ * See also half_rsqrt(), native_rsqrt().
+ */
+extern float __attribute__((const, overloadable))
+ rsqrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ rsqrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ rsqrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ rsqrt(float4 v);
+
+/*
+ * sign: Sign of a value
+ *
+ * Returns the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ */
+extern float __attribute__((const, overloadable))
+ sign(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sign(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sign(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sign(float4 v);
+
+/*
+ * sin: Sine
+ *
+ * Returns the sine of an angle measured in radians.
+ *
+ * See also native_sin().
+ */
+extern float __attribute__((const, overloadable))
+ sin(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sin(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sin(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sin(float4 v);
+
+/*
+ * sincos: Sine and cosine
+ *
+ * Returns the sine and cosine of a value.
+ *
+ * See also native_sincos().
+ *
+ * Parameters:
+ * v The incoming value in radians
+ * cos *cos will be set to the cosine value.
+ *
+ * Returns: sine of v
+ */
+extern float __attribute__((overloadable))
+ sincos(float v, float* cos);
+
+extern float2 __attribute__((overloadable))
+ sincos(float2 v, float2* cos);
+
+extern float3 __attribute__((overloadable))
+ sincos(float3 v, float3* cos);
+
+extern float4 __attribute__((overloadable))
+ sincos(float4 v, float4* cos);
+
+/*
+ * sinh: Hyperbolic sine
+ *
+ * Returns the hyperbolic sine of v, where v is measured in radians.
+ *
+ * See also native_sinh().
+ */
+extern float __attribute__((const, overloadable))
+ sinh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sinh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sinh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sinh(float4 v);
+
+/*
+ * sinpi: Sine of a number multiplied by pi
+ *
+ * Returns the sine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
+ *
+ * See also native_sinpi().
+ */
+extern float __attribute__((const, overloadable))
+ sinpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sinpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sinpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sinpi(float4 v);
+
+/*
+ * sqrt: Square root
+ *
+ * Returns the square root of a value.
+ *
+ * See also half_sqrt(), native_sqrt().
+ */
+extern float __attribute__((const, overloadable))
+ sqrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sqrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sqrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sqrt(float4 v);
+
+/*
+ * step: 0 if less than a value, 0 otherwise
+ *
+ * Returns 0.f if v < edge, 1.f otherwise.
+ *
+ * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
+ */
+extern float __attribute__((const, overloadable))
+ step(float edge, float v);
+
+extern float2 __attribute__((const, overloadable))
+ step(float2 edge, float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ step(float3 edge, float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ step(float4 edge, float4 v);
+
+extern float2 __attribute__((const, overloadable))
+ step(float2 edge, float v);
+
+extern float3 __attribute__((const, overloadable))
+ step(float3 edge, float v);
+
+extern float4 __attribute__((const, overloadable))
+ step(float4 edge, float v);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ step(float edge, float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ step(float edge, float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ step(float edge, float4 v);
+#endif
+
+/*
+ * tan: Tangent
+ *
+ * Returns the tangent of an angle measured in radians.
+ *
+ * See also native_tan().
+ */
+extern float __attribute__((const, overloadable))
+ tan(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tan(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tan(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tan(float4 v);
+
+/*
+ * tanh: Hyperbolic tangent
+ *
+ * Returns the hyperbolic tangent of a value.
+ *
+ * See also native_tanh().
+ */
+extern float __attribute__((const, overloadable))
+ tanh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tanh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tanh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tanh(float4 v);
+
+/*
+ * tanpi: Tangent of a number multiplied by pi
+ *
+ * Returns the tangent of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
+ *
+ * See also native_tanpi().
+ */
+extern float __attribute__((const, overloadable))
+ tanpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tanpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tanpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tanpi(float4 v);
+
+/*
+ * tgamma: Gamma function
+ *
+ * Returns the gamma function of a value.
+ *
+ * See also lgamma().
+ */
+extern float __attribute__((const, overloadable))
+ tgamma(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tgamma(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tgamma(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tgamma(float4 v);
+
+/*
+ * trunc: Truncates a floating point
+ *
+ * Rounds to integral using truncation.
+ *
+ * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
+ *
+ * See rint() and round() for other rounding options.
+ */
+extern float __attribute__((const, overloadable))
+ trunc(float v);
+
+extern float2 __attribute__((const, overloadable))
+ trunc(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ trunc(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ trunc(float4 v);
+
+/*
* rsClamp: Restrain a value to a range
*
* Clamp a value between low and high.
@@ -55,132 +4084,12 @@ extern uint __attribute__((const, always_inline, overloadable))
rsClamp(uint amount, uint low, uint high);
/*
- * Computes 6 frustum planes from the view projection matrix
- *
- * Parameters:
- * viewProj matrix to extract planes from
- * left left plane
- * right right plane
- * top top plane
- * bottom bottom plane
- * near near plane
- * far far plane
- */
-static inline void __attribute__((always_inline, overloadable))
- rsExtractFrustumPlanes(const rs_matrix4x4* viewProj, float4* left, float4* right, float4* top,
- float4* bottom, float4* near, float4* far) {
- // x y z w = a b c d in the plane equation
- left->x = viewProj->m[3] + viewProj->m[0];
- left->y = viewProj->m[7] + viewProj->m[4];
- left->z = viewProj->m[11] + viewProj->m[8];
- left->w = viewProj->m[15] + viewProj->m[12];
-
- right->x = viewProj->m[3] - viewProj->m[0];
- right->y = viewProj->m[7] - viewProj->m[4];
- right->z = viewProj->m[11] - viewProj->m[8];
- right->w = viewProj->m[15] - viewProj->m[12];
-
- top->x = viewProj->m[3] - viewProj->m[1];
- top->y = viewProj->m[7] - viewProj->m[5];
- top->z = viewProj->m[11] - viewProj->m[9];
- top->w = viewProj->m[15] - viewProj->m[13];
-
- bottom->x = viewProj->m[3] + viewProj->m[1];
- bottom->y = viewProj->m[7] + viewProj->m[5];
- bottom->z = viewProj->m[11] + viewProj->m[9];
- bottom->w = viewProj->m[15] + viewProj->m[13];
-
- near->x = viewProj->m[3] + viewProj->m[2];
- near->y = viewProj->m[7] + viewProj->m[6];
- near->z = viewProj->m[11] + viewProj->m[10];
- near->w = viewProj->m[15] + viewProj->m[14];
-
- far->x = viewProj->m[3] - viewProj->m[2];
- far->y = viewProj->m[7] - viewProj->m[6];
- far->z = viewProj->m[11] - viewProj->m[10];
- far->w = viewProj->m[15] - viewProj->m[14];
-
- float len = length(left->xyz);
- *left /= len;
- len = length(right->xyz);
- *right /= len;
- len = length(top->xyz);
- *top /= len;
- len = length(bottom->xyz);
- *bottom /= len;
- len = length(near->xyz);
- *near /= len;
- len = length(far->xyz);
- *far /= len;
-}
-
-/*
* Returns the fractional part of a float
*/
extern float __attribute__((const, overloadable))
rsFrac(float v);
/*
- * Checks if a sphere is withing the 6 frustum planes
- *
- * Parameters:
- * sphere float4 representing the sphere
- * left left plane
- * right right plane
- * top top plane
- * bottom bottom plane
- * near near plane
- * far far plane
- */
-static inline bool __attribute__((always_inline, overloadable))
- rsIsSphereInFrustum(float4* sphere, float4* left, float4* right, float4* top, float4* bottom,
- float4* near, float4* far) {
- float distToCenter = dot(left->xyz, sphere->xyz) + left->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- distToCenter = dot(right->xyz, sphere->xyz) + right->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- distToCenter = dot(top->xyz, sphere->xyz) + top->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- distToCenter = dot(near->xyz, sphere->xyz) + near->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- distToCenter = dot(far->xyz, sphere->xyz) + far->w;
- if (distToCenter < -sphere->w) {
- return false;
- }
- return true;
-}
-
-/*
- * Pack floating point (0-1) RGB values into a uchar4.
- *
- * For the float3 variant and the variant that only specifies r, g, b,
- * the alpha component is set to 255 (1.0).
- */
-extern uchar4 __attribute__((const, overloadable))
- rsPackColorTo8888(float r, float g, float b);
-
-extern uchar4 __attribute__((const, overloadable))
- rsPackColorTo8888(float r, float g, float b, float a);
-
-extern uchar4 __attribute__((const, overloadable))
- rsPackColorTo8888(float3 color);
-
-extern uchar4 __attribute__((const, overloadable))
- rsPackColorTo8888(float4 color);
-
-/*
* Return a random value between 0 (or min_value) and max_malue.
*/
extern int __attribute__((overloadable))
@@ -195,19 +4104,4 @@ extern float __attribute__((overloadable))
extern float __attribute__((overloadable))
rsRand(float min_value, float max_value);
-/*
- * Unpack a uchar4 color to float4. The resulting float range will be (0-1).
- */
-extern float4 __attribute__((const))
- rsUnpackColor8888(uchar4 c);
-
-/*
- * Convert from YUV to RGBA.
- */
-extern float4 __attribute__((const, overloadable))
- rsYuvToRGBA_float4(uchar y, uchar u, uchar v);
-
-extern uchar4 __attribute__((const, overloadable))
- rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v);
-
#endif // RENDERSCRIPT_RS_MATH_RSH
diff --git a/renderscript/include/rs_matrix.rsh b/renderscript/include/rs_matrix.rsh
index 3ed35a4..32496db 100644
--- a/renderscript/include/rs_matrix.rsh
+++ b/renderscript/include/rs_matrix.rsh
@@ -47,6 +47,110 @@
#ifndef RENDERSCRIPT_RS_MATRIX_RSH
#define RENDERSCRIPT_RS_MATRIX_RSH
+#include "rs_vector_math.rsh"
+
+/*
+ * Computes 6 frustum planes from the view projection matrix
+ *
+ * Parameters:
+ * viewProj matrix to extract planes from
+ * left left plane
+ * right right plane
+ * top top plane
+ * bottom bottom plane
+ * near near plane
+ * far far plane
+ */
+static inline void __attribute__((always_inline, overloadable))
+ rsExtractFrustumPlanes(const rs_matrix4x4* viewProj, float4* left, float4* right, float4* top,
+ float4* bottom, float4* near, float4* far) {
+ // x y z w = a b c d in the plane equation
+ left->x = viewProj->m[3] + viewProj->m[0];
+ left->y = viewProj->m[7] + viewProj->m[4];
+ left->z = viewProj->m[11] + viewProj->m[8];
+ left->w = viewProj->m[15] + viewProj->m[12];
+
+ right->x = viewProj->m[3] - viewProj->m[0];
+ right->y = viewProj->m[7] - viewProj->m[4];
+ right->z = viewProj->m[11] - viewProj->m[8];
+ right->w = viewProj->m[15] - viewProj->m[12];
+
+ top->x = viewProj->m[3] - viewProj->m[1];
+ top->y = viewProj->m[7] - viewProj->m[5];
+ top->z = viewProj->m[11] - viewProj->m[9];
+ top->w = viewProj->m[15] - viewProj->m[13];
+
+ bottom->x = viewProj->m[3] + viewProj->m[1];
+ bottom->y = viewProj->m[7] + viewProj->m[5];
+ bottom->z = viewProj->m[11] + viewProj->m[9];
+ bottom->w = viewProj->m[15] + viewProj->m[13];
+
+ near->x = viewProj->m[3] + viewProj->m[2];
+ near->y = viewProj->m[7] + viewProj->m[6];
+ near->z = viewProj->m[11] + viewProj->m[10];
+ near->w = viewProj->m[15] + viewProj->m[14];
+
+ far->x = viewProj->m[3] - viewProj->m[2];
+ far->y = viewProj->m[7] - viewProj->m[6];
+ far->z = viewProj->m[11] - viewProj->m[10];
+ far->w = viewProj->m[15] - viewProj->m[14];
+
+ float len = length(left->xyz);
+ *left /= len;
+ len = length(right->xyz);
+ *right /= len;
+ len = length(top->xyz);
+ *top /= len;
+ len = length(bottom->xyz);
+ *bottom /= len;
+ len = length(near->xyz);
+ *near /= len;
+ len = length(far->xyz);
+ *far /= len;
+}
+
+/*
+ * Checks if a sphere is withing the 6 frustum planes
+ *
+ * Parameters:
+ * sphere float4 representing the sphere
+ * left left plane
+ * right right plane
+ * top top plane
+ * bottom bottom plane
+ * near near plane
+ * far far plane
+ */
+static inline bool __attribute__((always_inline, overloadable))
+ rsIsSphereInFrustum(float4* sphere, float4* left, float4* right, float4* top, float4* bottom,
+ float4* near, float4* far) {
+ float distToCenter = dot(left->xyz, sphere->xyz) + left->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ distToCenter = dot(right->xyz, sphere->xyz) + right->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ distToCenter = dot(top->xyz, sphere->xyz) + top->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ distToCenter = dot(near->xyz, sphere->xyz) + near->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ distToCenter = dot(far->xyz, sphere->xyz) + far->w;
+ if (distToCenter < -sphere->w) {
+ return false;
+ }
+ return true;
+}
+
/*
* rsMatrixGet: Get one element
*
diff --git a/renderscript/include/rs_mesh.rsh b/renderscript/include/rs_mesh.rsh
deleted file mode 100644
index c404a5f..0000000
--- a/renderscript/include/rs_mesh.rsh
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_mesh.rsh: Mesh routines
- *
- */
-#ifndef RENDERSCRIPT_RS_MESH_RSH
-#define RENDERSCRIPT_RS_MESH_RSH
-
-/*
- * Returns an allocation containing index data or a null
- * allocation if only the primitive is specified
- *
- * Parameters:
- * m mesh to get data from
- * index index of the index allocation
- *
- * Returns: allocation containing index data
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_allocation __attribute__((overloadable))
- rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
-#endif
-
-/*
- * Returns the primitive describing how a part of the mesh is
- * rendered
- *
- * Parameters:
- * m mesh to get data from
- * index index of the primitive
- *
- * Returns: primitive describing how the mesh is rendered
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_primitive __attribute__((overloadable))
- rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
-#endif
-
-/*
- * Meshes could have multiple index sets, this function returns
- * the number.
- *
- * Parameters:
- * m mesh to get data from
- *
- * Returns: number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern uint32_t __attribute__((overloadable))
- rsgMeshGetPrimitiveCount(rs_mesh m);
-#endif
-
-/*
- * Returns an allocation that is part of the mesh and contains
- * vertex data, e.g. positions, normals, texcoords
- *
- * Parameters:
- * m mesh to get data from
- * index index of the vertex allocation
- *
- * Returns: allocation containing vertex data
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_allocation __attribute__((overloadable))
- rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
-#endif
-
-/*
- * Returns the number of allocations in the mesh that contain
- * vertex data
- *
- * Parameters:
- * m mesh to get data from
- *
- * Returns: number of allocations in the mesh that contain vertex data
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern uint32_t __attribute__((overloadable))
- rsgMeshGetVertexAllocationCount(rs_mesh m);
-#endif
-
-#endif // RENDERSCRIPT_RS_MESH_RSH
diff --git a/renderscript/include/rs_object.rsh b/renderscript/include/rs_object.rsh
deleted file mode 100644
index c7205e3..0000000
--- a/renderscript/include/rs_object.rsh
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_object.rsh: Object routines
- *
- */
-#ifndef RENDERSCRIPT_RS_OBJECT_RSH
-#define RENDERSCRIPT_RS_OBJECT_RSH
-
-/*
- * rsClearObject: For internal use.
- *
- */
-extern void __attribute__((overloadable))
- rsClearObject(rs_element* dst);
-
-extern void __attribute__((overloadable))
- rsClearObject(rs_type* dst);
-
-extern void __attribute__((overloadable))
- rsClearObject(rs_allocation* dst);
-
-extern void __attribute__((overloadable))
- rsClearObject(rs_sampler* dst);
-
-extern void __attribute__((overloadable))
- rsClearObject(rs_script* dst);
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_mesh* dst);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_program_fragment* dst);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_program_vertex* dst);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_program_raster* dst);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_program_store* dst);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsClearObject(rs_font* dst);
-#endif
-
-/*
- * rsIsObject: For internal use.
- *
- */
-extern bool __attribute__((overloadable))
- rsIsObject(rs_element v);
-
-extern bool __attribute__((overloadable))
- rsIsObject(rs_type v);
-
-extern bool __attribute__((overloadable))
- rsIsObject(rs_allocation v);
-
-extern bool __attribute__((overloadable))
- rsIsObject(rs_sampler v);
-
-extern bool __attribute__((overloadable))
- rsIsObject(rs_script v);
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_mesh v);
-#endif
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_program_fragment v);
-#endif
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_program_vertex v);
-#endif
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_program_raster v);
-#endif
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_program_store v);
-#endif
-
-#ifndef __LP64__
-extern bool __attribute__((overloadable))
- rsIsObject(rs_font v);
-#endif
-
-/*
- * rsSetObject: For internal use.
- *
- */
-extern void __attribute__((overloadable))
- rsSetObject(rs_element* dst, rs_element src);
-
-extern void __attribute__((overloadable))
- rsSetObject(rs_type* dst, rs_type src);
-
-extern void __attribute__((overloadable))
- rsSetObject(rs_allocation* dst, rs_allocation src);
-
-extern void __attribute__((overloadable))
- rsSetObject(rs_sampler* dst, rs_sampler src);
-
-extern void __attribute__((overloadable))
- rsSetObject(rs_script* dst, rs_script src);
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_mesh* dst, rs_mesh src);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_program_fragment* dst, rs_program_fragment src);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_program_vertex* dst, rs_program_vertex src);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_program_raster* dst, rs_program_raster src);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_program_store* dst, rs_program_store src);
-#endif
-
-#ifndef __LP64__
-extern void __attribute__((overloadable))
- rsSetObject(rs_font* dst, rs_font src);
-#endif
-
-#endif // RENDERSCRIPT_RS_OBJECT_RSH
diff --git a/renderscript/include/rs_element.rsh b/renderscript/include/rs_object_info.rsh
index 91233c2..25ac326 100644
--- a/renderscript/include/rs_element.rsh
+++ b/renderscript/include/rs_object_info.rsh
@@ -17,7 +17,7 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
/*
- * rs_element.rsh: Element functions
+ * rs_object_info.rsh: Element functions
*
* The term "element" is used a bit ambiguously in RenderScript, as both
* the type of an item of an allocation and the instantiation of that type:
@@ -39,8 +39,110 @@
* Elements can also have a kind, which is semantic information used mostly to
* interpret pixel data.
*/
-#ifndef RENDERSCRIPT_RS_ELEMENT_RSH
-#define RENDERSCRIPT_RS_ELEMENT_RSH
+#ifndef RENDERSCRIPT_RS_OBJECT_INFO_RSH
+#define RENDERSCRIPT_RS_OBJECT_INFO_RSH
+
+/*
+ * rsAllocationGetDimFaces: Presence of more than one face
+ *
+ * If the allocation is a cubemap, this function returns 1 if there's more than one
+ * face present. In all other cases, it returns 0.
+ *
+ * Returns: Returns 1 if more than one face is present, 0 otherwise.
+ */
+extern uint32_t __attribute__((overloadable))
+ rsAllocationGetDimFaces(rs_allocation a);
+
+/*
+ * rsAllocationGetDimLOD: Presence of levels of details
+ *
+ * Query an allocation for the presence of more than one Level Of Details. This is useful for mipmaps.
+ *
+ * Returns: Returns 1 if more than one LOD is present, 0 otherwise.
+ */
+extern uint32_t __attribute__((overloadable))
+ rsAllocationGetDimLOD(rs_allocation a);
+
+/*
+ * rsAllocationGetDimX: Size of the X dimension
+ *
+ * Returns the size of the X dimension of the allocation.
+ *
+ * Returns: The X dimension of the allocation.
+ */
+extern uint32_t __attribute__((overloadable))
+ rsAllocationGetDimX(rs_allocation a);
+
+/*
+ * rsAllocationGetDimY: Size of the Y dimension
+ *
+ * Returns the size of the Y dimension of the allocation.
+ * If the allocation has less than two dimensions, returns 0.
+ *
+ * Returns: The Y dimension of the allocation.
+ */
+extern uint32_t __attribute__((overloadable))
+ rsAllocationGetDimY(rs_allocation a);
+
+/*
+ * rsAllocationGetDimZ: Size of the Z dimension
+ *
+ * Returns the size of the Z dimension of the allocation.
+ * If the allocation has less than three dimensions, returns 0.
+ *
+ * Returns: The Z dimension of the allocation.
+ */
+extern uint32_t __attribute__((overloadable))
+ rsAllocationGetDimZ(rs_allocation a);
+
+/*
+ * Get the element object describing the allocation's layout
+ *
+ * Parameters:
+ * a allocation to get data from
+ *
+ * Returns: element describing allocation layout
+ */
+extern rs_element __attribute__((overloadable))
+ rsAllocationGetElement(rs_allocation a);
+
+/*
+ * rsClearObject: For internal use.
+ *
+ */
+extern void __attribute__((overloadable))
+ rsClearObject(rs_element* dst);
+
+extern void __attribute__((overloadable))
+ rsClearObject(rs_type* dst);
+
+extern void __attribute__((overloadable))
+ rsClearObject(rs_allocation* dst);
+
+extern void __attribute__((overloadable))
+ rsClearObject(rs_sampler* dst);
+
+extern void __attribute__((overloadable))
+ rsClearObject(rs_script* dst);
+
+/*
+ * rsIsObject: For internal use.
+ *
+ */
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_element v);
+
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_type v);
+
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_allocation v);
+
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_sampler v);
+
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_script v);
/*
* rsElementGetBytesSize: Return the size of an element
@@ -202,4 +304,101 @@ extern uint32_t __attribute__((overloadable))
rsElementGetVectorSize(rs_element e);
#endif
-#endif // RENDERSCRIPT_RS_ELEMENT_RSH
+/*
+ * rsGetAllocation: Returns the Allocation for a given pointer
+ *
+ * Returns the Allocation for a given pointer. The pointer should point within
+ * a valid allocation. The results are undefined if the pointer is not from a
+ * valid allocation.
+ *
+ * This function is deprecated and will be removed from the SDK in a future
+ * release.
+ */
+extern rs_allocation __attribute__((overloadable))
+ rsGetAllocation(const void* p);
+
+/*
+ * Get sampler anisotropy
+ *
+ * Parameters:
+ * s sampler to query
+ *
+ * Returns: anisotropy
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern float __attribute__((overloadable))
+ rsSamplerGetAnisotropy(rs_sampler s);
+#endif
+
+/*
+ * Get sampler magnification value
+ *
+ * Parameters:
+ * s sampler to query
+ *
+ * Returns: magnification value
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_sampler_value __attribute__((overloadable))
+ rsSamplerGetMagnification(rs_sampler s);
+#endif
+
+/*
+ * Get sampler minification value
+ *
+ * Parameters:
+ * s sampler to query
+ *
+ * Returns: minification value
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_sampler_value __attribute__((overloadable))
+ rsSamplerGetMinification(rs_sampler s);
+#endif
+
+/*
+ * Get sampler wrap S value
+ *
+ * Parameters:
+ * s sampler to query
+ *
+ * Returns: wrap S value
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_sampler_value __attribute__((overloadable))
+ rsSamplerGetWrapS(rs_sampler s);
+#endif
+
+/*
+ * Get sampler wrap T value
+ *
+ * Parameters:
+ * s sampler to query
+ *
+ * Returns: wrap T value
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern rs_sampler_value __attribute__((overloadable))
+ rsSamplerGetWrapT(rs_sampler s);
+#endif
+
+/*
+ * rsSetObject: For internal use.
+ *
+ */
+extern void __attribute__((overloadable))
+ rsSetObject(rs_element* dst, rs_element src);
+
+extern void __attribute__((overloadable))
+ rsSetObject(rs_type* dst, rs_type src);
+
+extern void __attribute__((overloadable))
+ rsSetObject(rs_allocation* dst, rs_allocation src);
+
+extern void __attribute__((overloadable))
+ rsSetObject(rs_sampler* dst, rs_sampler src);
+
+extern void __attribute__((overloadable))
+ rsSetObject(rs_script* dst, rs_script src);
+
+#endif // RENDERSCRIPT_RS_OBJECT_INFO_RSH
diff --git a/renderscript/include/rs_object_types.rsh b/renderscript/include/rs_object_types.rsh
new file mode 100644
index 0000000..982038d
--- /dev/null
+++ b/renderscript/include/rs_object_types.rsh
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_object_types.rsh: Standard RenderScript types
+ *
+ * TODO desc.
+ */
+#ifndef RENDERSCRIPT_RS_OBJECT_TYPES_RSH
+#define RENDERSCRIPT_RS_OBJECT_TYPES_RSH
+
+#define NULL ((void *)0)
+
+// Opaque handle to a RenderScript object. Do not use this directly.
+#ifndef __LP64__
+#define _RS_HANDLE \
+struct {\
+ const int* const p;\
+} __attribute__((packed, aligned(4)))
+#else
+#define _RS_HANDLE \
+struct {\
+ const long* const p;\
+ const long* const r;\
+ const long* const v1;\
+ const long* const v2;\
+}
+#endif
+
+/*
+ * rs_element: Handle to an element
+ *
+ * Opaque handle to a RenderScript element.
+ * See: android.renderscript.Element
+ */
+typedef _RS_HANDLE rs_element;
+
+/*
+ * rs_type: Handle to a Type
+ *
+ * Opaque handle to a RenderScript type.
+ * See: android.renderscript.Type
+ */
+typedef _RS_HANDLE rs_type;
+
+/*
+ * rs_allocation: Handle to an allocation
+ *
+ * Opaque handle to a RenderScript allocation.
+ * See: android.renderscript.Allocation
+ */
+typedef _RS_HANDLE rs_allocation;
+
+/*
+ * rs_sampler: Handle to a Sampler
+ *
+ * Opaque handle to a RenderScript sampler object.
+ * See: android.renderscript.Sampler
+ */
+typedef _RS_HANDLE rs_sampler;
+
+/*
+ * rs_script: Handle to a Script
+ *
+ * Opaque handle to a RenderScript script object.
+ * See: android.renderscript.ScriptC
+ */
+typedef _RS_HANDLE rs_script;
+
+/*
+ * rs_matrix4x4: 4x4 matrix of 32 bit floats
+ *
+ * Native holder for RS matrix. Elements are stored in the array at the
+ * location [row*4 + col]
+ */
+typedef struct {
+ float m[16];
+} rs_matrix4x4;
+
+/*
+ * rs_matrix3x3: 3x3 matrix of 32 bit floats
+ *
+ * Native holder for RS matrix. Elements are stored in the array at the
+ * location [row*3 + col]
+ */
+typedef struct {
+ float m[9];
+} rs_matrix3x3;
+
+/*
+ * rs_matrix2x2: 2x2 matrix of 32 bit floats
+ *
+ * Native holder for RS matrix. Elements are stored in the array at the
+ * location [row*2 + col]
+ */
+typedef struct {
+ float m[4];
+} rs_matrix2x2;
+
+/*
+ * rs_quaternion: Quarternion
+ *
+ * Quaternion type for use with the quaternion functions
+ */
+typedef float4 rs_quaternion;
+
+/*
+ * rs_allocation_cubemap_face: Enum for selecting cube map faces
+ *
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+typedef enum {
+ RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
+ RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
+ RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
+ RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
+ RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
+ RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
+} rs_allocation_cubemap_face;
+#endif
+
+/*
+ * rs_allocation_usage_type: Bitfield to specify the usage types for an allocation
+ *
+ * These values are ORed together to specify which usages or memory spaces are
+ * relevant to an allocation or an operation on an allocation.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+typedef enum {
+ RS_ALLOCATION_USAGE_SCRIPT = 0x0001,
+ RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, // Deprecated.
+ RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, // Deprecated.
+ RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, // Deprecated.
+ RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010 // Deprecated.
+} rs_allocation_usage_type;
+#endif
+
+/*
+ * rs_data_type: Element data types
+ *
+ * DataType represents the basic type information for a basic element. The
+ * naming convention follows. For numeric types it is FLOAT,
+ * SIGNED, or UNSIGNED followed by the _BITS where BITS is the
+ * size of the data. BOOLEAN is a true / false (1,0)
+ * represented in an 8 bit container. The UNSIGNED variants
+ * with multiple bit definitions are for packed graphical data
+ * formats and represent vectors with per vector member sizes
+ * which are treated as a single unit for packing and alignment
+ * purposes.
+ *
+ * MATRIX the three matrix types contain FLOAT_32 elements and are treated
+ * as 32 bits for alignment purposes.
+ *
+ * RS_* objects. 32 bit opaque handles.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_TYPE_NONE = 0,
+ RS_TYPE_FLOAT_32 = 2,
+ RS_TYPE_FLOAT_64 = 3,
+ RS_TYPE_SIGNED_8 = 4,
+ RS_TYPE_SIGNED_16 = 5,
+ RS_TYPE_SIGNED_32 = 6,
+ RS_TYPE_SIGNED_64 = 7,
+ RS_TYPE_UNSIGNED_8 = 8,
+ RS_TYPE_UNSIGNED_16 = 9,
+ RS_TYPE_UNSIGNED_32 = 10,
+ RS_TYPE_UNSIGNED_64 = 11,
+ RS_TYPE_BOOLEAN = 12,
+ RS_TYPE_UNSIGNED_5_6_5 = 13,
+ RS_TYPE_UNSIGNED_5_5_5_1 = 14,
+ RS_TYPE_UNSIGNED_4_4_4_4 = 15,
+ RS_TYPE_MATRIX_4X4 = 16,
+ RS_TYPE_MATRIX_3X3 = 17,
+ RS_TYPE_MATRIX_2X2 = 18,
+ RS_TYPE_ELEMENT = 1000,
+ RS_TYPE_TYPE = 1001,
+ RS_TYPE_ALLOCATION = 1002,
+ RS_TYPE_SAMPLER = 1003,
+ RS_TYPE_SCRIPT = 1004,
+ RS_TYPE_MESH = 1005,
+ RS_TYPE_PROGRAM_FRAGMENT = 1006,
+ RS_TYPE_PROGRAM_VERTEX = 1007,
+ RS_TYPE_PROGRAM_RASTER = 1008,
+ RS_TYPE_PROGRAM_STORE = 1009,
+ RS_TYPE_FONT = 1010,
+ RS_TYPE_INVALID = 10000
+} rs_data_type;
+#endif
+
+/*
+ * rs_data_kind: Element data kind
+ *
+ * The special interpretation of the data if required. This is primarly
+ * useful for graphical data. USER indicates no special interpretation is
+ * expected. PIXEL is used in conjunction with the standard data types for
+ * representing texture formats.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_KIND_USER = 0,
+ RS_KIND_PIXEL_L = 7,
+ RS_KIND_PIXEL_A = 8,
+ RS_KIND_PIXEL_LA = 9,
+ RS_KIND_PIXEL_RGB = 10,
+ RS_KIND_PIXEL_RGBA = 11,
+ RS_KIND_PIXEL_DEPTH = 12,
+ RS_KIND_PIXEL_YUV = 13,
+ RS_KIND_INVALID = 100
+} rs_data_kind;
+#endif
+
+/*
+ * rs_sampler_value: Sampler wrap T value
+ *
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+typedef enum {
+ RS_SAMPLER_NEAREST = 0,
+ RS_SAMPLER_LINEAR = 1,
+ RS_SAMPLER_LINEAR_MIP_LINEAR = 2,
+ RS_SAMPLER_WRAP = 3,
+ RS_SAMPLER_CLAMP = 4,
+ RS_SAMPLER_LINEAR_MIP_NEAREST = 5,
+ RS_SAMPLER_MIRRORED_REPEAT = 6,
+ RS_SAMPLER_INVALID = 100
+} rs_sampler_value;
+#endif
+
+#endif // RENDERSCRIPT_RS_OBJECT_TYPES_RSH
diff --git a/renderscript/include/rs_program.rsh b/renderscript/include/rs_program.rsh
deleted file mode 100644
index 78a9848..0000000
--- a/renderscript/include/rs_program.rsh
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_program.rsh: Program object routines
- *
- */
-#ifndef RENDERSCRIPT_RS_PROGRAM_RSH
-#define RENDERSCRIPT_RS_PROGRAM_RSH
-
-/*
- * Get program raster cull mode
- *
- * Parameters:
- * pr program raster to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_cull_mode __attribute__((overloadable))
- rsgProgramRasterGetCullMode(rs_program_raster pr);
-#endif
-
-/*
- * Get program raster point sprite state
- *
- * Parameters:
- * pr program raster to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr);
-#endif
-
-/*
- * Get program store blend destination function
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_blend_dst_func __attribute__((overloadable))
- rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
-#endif
-
-/*
- * Get program store blend source function
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_blend_src_func __attribute__((overloadable))
- rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
-#endif
-
-/*
- * Get program store depth function
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_depth_func __attribute__((overloadable))
- rsgProgramStoreGetDepthFunc(rs_program_store ps);
-#endif
-
-/*
- * Get program store alpha component color mask
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps);
-#endif
-
-/*
- * Get program store blur component color mask
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps);
-#endif
-
-/*
- * Get program store green component color mask
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps);
-#endif
-
-/*
- * Get program store red component color mask
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps);
-#endif
-
-/*
- * Get program store depth mask
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps);
-#endif
-
-/*
- * Get program store dither state
- *
- * Parameters:
- * ps program store to query
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern bool __attribute__((overloadable))
- rsgProgramStoreIsDitherEnabled(rs_program_store ps);
-#endif
-
-#endif // RENDERSCRIPT_RS_PROGRAM_RSH
diff --git a/renderscript/include/rs_sampler.rsh b/renderscript/include/rs_sampler.rsh
deleted file mode 100644
index 4b1b778..0000000
--- a/renderscript/include/rs_sampler.rsh
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_sampler.rsh: Sampler routines
- *
- */
-#ifndef RENDERSCRIPT_RS_SAMPLER_RSH
-#define RENDERSCRIPT_RS_SAMPLER_RSH
-
-/*
- * Get sampler anisotropy
- *
- * Parameters:
- * s sampler to query
- *
- * Returns: anisotropy
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern float __attribute__((overloadable))
- rsSamplerGetAnisotropy(rs_sampler s);
-#endif
-
-/*
- * Get sampler magnification value
- *
- * Parameters:
- * s sampler to query
- *
- * Returns: magnification value
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_sampler_value __attribute__((overloadable))
- rsSamplerGetMagnification(rs_sampler s);
-#endif
-
-/*
- * Get sampler minification value
- *
- * Parameters:
- * s sampler to query
- *
- * Returns: minification value
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_sampler_value __attribute__((overloadable))
- rsSamplerGetMinification(rs_sampler s);
-#endif
-
-/*
- * Get sampler wrap S value
- *
- * Parameters:
- * s sampler to query
- *
- * Returns: wrap S value
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_sampler_value __attribute__((overloadable))
- rsSamplerGetWrapS(rs_sampler s);
-#endif
-
-/*
- * Get sampler wrap T value
- *
- * Parameters:
- * s sampler to query
- *
- * Returns: wrap T value
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-extern rs_sampler_value __attribute__((overloadable))
- rsSamplerGetWrapT(rs_sampler s);
-#endif
-
-#endif // RENDERSCRIPT_RS_SAMPLER_RSH
diff --git a/renderscript/include/rs_types.rsh b/renderscript/include/rs_types.rsh
deleted file mode 100644
index b174933..0000000
--- a/renderscript/include/rs_types.rsh
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-/*
- * rs_types.rsh: Standard RenderScript types
- *
- * Integers:
- * 8 bit: char, int8_t
- * 16 bit: short, int16_t
- * 32 bit: int, in32_t
- * 64 bit: long, long long, int64_t
- *
- * Unsigned integers:
- * 8 bit: uchar, uint8_t
- * 16 bit: ushort, uint16_t
- * 32 bit: uint, uint32_t
- * 64 bit: ulong, uint64_t
- *
- * Floating point:
- * 32 bit: float
- * 64 bit: double
- *
- * Vectors of length 2, 3, and 4 are supported for all the types above.
- */
-#ifndef RENDERSCRIPT_RS_TYPES_RSH
-#define RENDERSCRIPT_RS_TYPES_RSH
-
-#include "stdbool.h"
-
-#define RS_PACKED __attribute__((packed, aligned(4)))
-#define NULL ((void *)0)
-
-// Opaque handle to a RenderScript object. Do not use this directly.
-#ifndef __LP64__
-#define _RS_HANDLE \
-struct {\
- const int* const p;\
-} __attribute__((packed, aligned(4)))
-#else
-#define _RS_HANDLE \
-struct {\
- const long* const p;\
- const long* const r;\
- const long* const v1;\
- const long* const v2;\
-}
-#endif
-
-/*
- * M_1_PI: 1 / pi, as a 32 bit float
- *
- * The inverse of pi, as a 32 bit float.
- */
-#define M_1_PI 0.318309886183790671537767526745028724f
-
-/*
- * M_2_PI: 2 / pi, as a 32 bit float
- *
- * 2 divided by pi, as a 32 bit float.
- */
-#define M_2_PI 0.636619772367581343075535053490057448f
-
-/*
- * M_2_PIl: Deprecated. Use M_2_PI instead.
- *
- */
-#define M_2_PIl 0.636619772367581343075535053490057448f
-
-/*
- * M_2_SQRTPI: 2 / sqrt(pi), as a 32 bit float
- *
- * 2 divided by the square root of pi, as a 32 bit float.
- */
-#define M_2_SQRTPI 1.128379167095512573896158903121545172f
-
-/*
- * M_E: e, as a 32 bit float
- *
- * The number e, the base of the natural logarithm, as a 32 bit float.
- */
-#define M_E 2.718281828459045235360287471352662498f
-
-/*
- * M_LN10: log_e(10), as a 32 bit float
- *
- * The natural logarithm of 10, as a 32 bit float.
- */
-#define M_LN10 2.302585092994045684017991454684364208f
-
-/*
- * M_LN2: log_e(2), as a 32 bit float
- *
- * The natural logarithm of 2, as a 32 bit float.
- */
-#define M_LN2 0.693147180559945309417232121458176568f
-
-/*
- * M_LOG10E: log_10(e), as a 32 bit float
- *
- * The logarithm base 10 of e, as a 32 bit float.
- */
-#define M_LOG10E 0.434294481903251827651128918916605082f
-
-/*
- * M_LOG2E: log_2(e), as a 32 bit float
- *
- * The logarithm base 2 of e, as a 32 bit float.
- */
-#define M_LOG2E 1.442695040888963407359924681001892137f
-
-/*
- * M_PI: pi, as a 32 bit float
- *
- * The constant pi, as a 32 bit float.
- */
-#define M_PI 3.141592653589793238462643383279502884f
-
-/*
- * M_PI_2: pi / 2, as a 32 bit float
- *
- * Pi divided by 2, as a 32 bit float.
- */
-#define M_PI_2 1.570796326794896619231321691639751442f
-
-/*
- * M_PI_4: pi / 4, as a 32 bit float
- *
- * Pi divided by 4, as a 32 bit float.
- */
-#define M_PI_4 0.785398163397448309615660845819875721f
-
-/*
- * M_SQRT1_2: 1 / sqrt(2), as a 32 bit float
- *
- * The inverse of the square root of 2, as a 32 bit float.
- */
-#define M_SQRT1_2 0.707106781186547524400844362104849039f
-
-/*
- * M_SQRT2: sqrt(2), as a 32 bit float
- *
- * The square root of 2, as a 32 bit float.
- */
-#define M_SQRT2 1.414213562373095048801688724209698079f
-
-/*
- * int8_t: 8 bit signed integer
- *
- * 8 bit integer type
- */
-typedef char int8_t;
-
-/*
- * int16_t: 16 bit signed integer
- *
- * 16 bit integer type
- */
-typedef short int16_t;
-
-/*
- * int32_t: 32 bit signed integer
- *
- * 32 bit integer type
- */
-typedef int int32_t;
-
-/*
- * int64_t: 64 bit signed integer
- *
- * 64 bit integer type
- */
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-typedef long long int64_t;
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-typedef long int64_t;
-#endif
-
-/*
- * uint8_t: 8 bit unsigned integer
- *
- * 8 bit unsigned integer type
- */
-typedef unsigned char uint8_t;
-
-/*
- * uint16_t: 16 bit unsigned integer
- *
- * 16 bit unsigned integer type
- */
-typedef unsigned short uint16_t;
-
-/*
- * uint32_t: 32 bit unsigned integer
- *
- * 32 bit unsigned integer type
- */
-typedef unsigned int uint32_t;
-
-/*
- * uint64_t: 64 bit unsigned integer
- *
- * 64 bit unsigned integer type
- */
-#if !defined(RS_VERSION) || (RS_VERSION <= 20)
-typedef unsigned long long uint64_t;
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 21))
-typedef unsigned long uint64_t;
-#endif
-
-/*
- * uchar: 8 bit unsigned integer
- *
- * 8 bit unsigned integer type
- */
-typedef uint8_t uchar;
-
-/*
- * ushort: 16 bit unsigned integer
- *
- * 16 bit unsigned integer type
- */
-typedef uint16_t ushort;
-
-/*
- * uint: 32 bit unsigned integer
- *
- * 32 bit unsigned integer type
- */
-typedef uint32_t uint;
-
-/*
- * ulong: 64 bit unsigned integer
- *
- * Typedef for unsigned long (use for 64-bit unsigned integers)
- */
-typedef uint64_t ulong;
-
-/*
- * size_t: Unsigned size type
- *
- * Typedef for size_t
- */
-#ifdef __LP64__
-typedef uint64_t size_t;
-#endif
-
-#ifndef __LP64__
-typedef uint32_t size_t;
-#endif
-
-/*
- * ssize_t: Signed size type
- *
- * Typedef for ssize_t
- */
-#ifdef __LP64__
-typedef int64_t ssize_t;
-#endif
-
-#ifndef __LP64__
-typedef int32_t ssize_t;
-#endif
-
-/*
- * rs_element: Handle to an element
- *
- * Opaque handle to a RenderScript element.
- * See: android.renderscript.Element
- */
-typedef _RS_HANDLE rs_element;
-
-/*
- * rs_type: Handle to a Type
- *
- * Opaque handle to a RenderScript type.
- * See: android.renderscript.Type
- */
-typedef _RS_HANDLE rs_type;
-
-/*
- * rs_allocation: Handle to an allocation
- *
- * Opaque handle to a RenderScript allocation.
- * See: android.renderscript.Allocation
- */
-typedef _RS_HANDLE rs_allocation;
-
-/*
- * rs_sampler: Handle to a Sampler
- *
- * Opaque handle to a RenderScript sampler object.
- * See: android.renderscript.Sampler
- */
-typedef _RS_HANDLE rs_sampler;
-
-/*
- * rs_script: Handle to a Script
- *
- * Opaque handle to a RenderScript script object.
- * See: android.renderscript.ScriptC
- */
-typedef _RS_HANDLE rs_script;
-
-/*
- * rs_mesh: Handle to a Mesh
- *
- * Opaque handle to a RenderScript mesh object.
- * See: android.renderscript.Mesh
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_mesh;
-#endif
-
-/*
- * rs_program_fragment: Handle to a ProgramFragment
- *
- * Opaque handle to a RenderScript ProgramFragment object.
- * See: android.renderscript.ProgramFragment
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_program_fragment;
-#endif
-
-/*
- * rs_program_vertex: Handle to a ProgramVertex
- *
- * Opaque handle to a RenderScript ProgramVertex object.
- * See: android.renderscript.ProgramVertex
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_program_vertex;
-#endif
-
-/*
- * rs_program_raster: Handle to a ProgramRaster
- *
- * Opaque handle to a RenderScript ProgramRaster object.
- * See: android.renderscript.ProgramRaster
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_program_raster;
-#endif
-
-/*
- * rs_program_store: Handle to a ProgramStore
- *
- * Opaque handle to a RenderScript ProgramStore object.
- * See: android.renderscript.ProgramStore
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_program_store;
-#endif
-
-/*
- * rs_font: Handle to a Font
- *
- * Opaque handle to a RenderScript font object.
- * See: android.renderscript.Font
- */
-#ifndef __LP64__
-typedef _RS_HANDLE rs_font;
-#endif
-
-/*
- * float2: Two 32 bit floats
- *
- * Vector version of the basic float type.
- * Provides two float fields packed into a single 64 bit field with 64 bit alignment.
- */
-typedef float __attribute__((ext_vector_type(2))) float2;
-
-/*
- * float3: Three 32 bit floats
- *
- * Vector version of the basic float type.
- * Provides three float fields packed into a single 128 bit field with 128 bit alignment.
- */
-typedef float __attribute__((ext_vector_type(3))) float3;
-
-/*
- * float4: Four 32 bit floats
- *
- * Vector version of the basic float type.
- * Provides four float fields packed into a single 128 bit field with 128 bit alignment.
- */
-typedef float __attribute__((ext_vector_type(4))) float4;
-
-/*
- * double2: Two 64 bit floats
- *
- * Vector version of the basic double type. Provides two double fields packed
- * into a single 128 bit field with 128 bit alignment.
- */
-typedef double __attribute__((ext_vector_type(2))) double2;
-
-/*
- * double3: Three 64 bit floats
- *
- * Vector version of the basic double type. Provides three double fields packed
- * into a single 256 bit field with 256 bit alignment.
- */
-typedef double __attribute__((ext_vector_type(3))) double3;
-
-/*
- * double4: Four 64 bit floats
- *
- * Vector version of the basic double type. Provides four double fields packed
- * into a single 256 bit field with 256 bit alignment.
- */
-typedef double __attribute__((ext_vector_type(4))) double4;
-
-/*
- * uchar2: Two 8 bit unsigned integers
- *
- * Vector version of the basic uchar type. Provides two uchar fields packed
- * into a single 16 bit field with 16 bit alignment.
- */
-typedef uchar __attribute__((ext_vector_type(2))) uchar2;
-
-/*
- * uchar3: Three 8 bit unsigned integers
- *
- * Vector version of the basic uchar type. Provides three uchar fields packed
- * into a single 32 bit field with 32 bit alignment.
- */
-typedef uchar __attribute__((ext_vector_type(3))) uchar3;
-
-/*
- * uchar4: Four 8 bit unsigned integers
- *
- * Vector version of the basic uchar type. Provides four uchar fields packed
- * into a single 32 bit field with 32 bit alignment.
- */
-typedef uchar __attribute__((ext_vector_type(4))) uchar4;
-
-/*
- * ushort2: Two 16 bit unsigned integers
- *
- * Vector version of the basic ushort type. Provides two ushort fields packed
- * into a single 32 bit field with 32 bit alignment.
- */
-typedef ushort __attribute__((ext_vector_type(2))) ushort2;
-
-/*
- * ushort3: Three 16 bit unsigned integers
- *
- * Vector version of the basic ushort type. Provides three ushort fields packed
- * into a single 64 bit field with 64 bit alignment.
- */
-typedef ushort __attribute__((ext_vector_type(3))) ushort3;
-
-/*
- * ushort4: Four 16 bit unsigned integers
- *
- * Vector version of the basic ushort type. Provides four ushort fields packed
- * into a single 64 bit field with 64 bit alignment.
- */
-typedef ushort __attribute__((ext_vector_type(4))) ushort4;
-
-/*
- * uint2: Two 32 bit unsigned integers
- *
- * Vector version of the basic uint type. Provides two uint fields packed into a
- * single 64 bit field with 64 bit alignment.
- */
-typedef uint __attribute__((ext_vector_type(2))) uint2;
-
-/*
- * uint3: Three 32 bit unsigned integers
- *
- * Vector version of the basic uint type. Provides three uint fields packed into
- * a single 128 bit field with 128 bit alignment.
- */
-typedef uint __attribute__((ext_vector_type(3))) uint3;
-
-/*
- * uint4: Four 32 bit unsigned integers
- *
- * Vector version of the basic uint type. Provides four uint fields packed into
- * a single 128 bit field with 128 bit alignment.
- */
-typedef uint __attribute__((ext_vector_type(4))) uint4;
-
-/*
- * ulong2: Two 64 bit unsigned integers
- *
- * Vector version of the basic ulong type. Provides two ulong fields packed into
- * a single 128 bit field with 128 bit alignment.
- */
-typedef ulong __attribute__((ext_vector_type(2))) ulong2;
-
-/*
- * ulong3: Three 64 bit unsigned integers
- *
- * Vector version of the basic ulong type. Provides three ulong fields packed
- * into a single 256 bit field with 256 bit alignment.
- */
-typedef ulong __attribute__((ext_vector_type(3))) ulong3;
-
-/*
- * ulong4: Four 64 bit unsigned integers
- *
- * Vector version of the basic ulong type. Provides four ulong fields packed
- * into a single 256 bit field with 256 bit alignment.
- */
-typedef ulong __attribute__((ext_vector_type(4))) ulong4;
-
-/*
- * char2: Two 8 bit signed integers
- *
- * Vector version of the basic char type. Provides two char fields packed into a
- * single 16 bit field with 16 bit alignment.
- */
-typedef char __attribute__((ext_vector_type(2))) char2;
-
-/*
- * char3: Three 8 bit signed integers
- *
- * Vector version of the basic char type. Provides three char fields packed into
- * a single 32 bit field with 32 bit alignment.
- */
-typedef char __attribute__((ext_vector_type(3))) char3;
-
-/*
- * char4: Four 8 bit signed integers
- *
- * Vector version of the basic char type. Provides four char fields packed into
- * a single 32 bit field with 32 bit alignment.
- */
-typedef char __attribute__((ext_vector_type(4))) char4;
-
-/*
- * short2: Two 16 bit signed integers
- *
- * Vector version of the basic short type. Provides two short fields packed into
- * a single 32 bit field with 32 bit alignment.
- */
-typedef short __attribute__((ext_vector_type(2))) short2;
-
-/*
- * short3: Three 16 bit signed integers
- *
- * Vector version of the basic short type. Provides three short fields packed
- * into a single 64 bit field with 64 bit alignment.
- */
-typedef short __attribute__((ext_vector_type(3))) short3;
-
-/*
- * short4: Four 16 bit signed integers
- *
- * Vector version of the basic short type. Provides four short fields packed
- * into a single 64 bit field with 64 bit alignment.
- */
-typedef short __attribute__((ext_vector_type(4))) short4;
-
-/*
- * int2: Two 32 bit signed integers
- *
- * Vector version of the basic int type. Provides two int fields packed into a
- * single 64 bit field with 64 bit alignment.
- */
-typedef int __attribute__((ext_vector_type(2))) int2;
-
-/*
- * int3: Three 32 bit signed integers
- *
- * Vector version of the basic int type. Provides three int fields packed into a
- * single 128 bit field with 128 bit alignment.
- */
-typedef int __attribute__((ext_vector_type(3))) int3;
-
-/*
- * int4: Four 32 bit signed integers
- *
- * Vector version of the basic int type. Provides two four fields packed into a
- * single 128 bit field with 128 bit alignment.
- */
-typedef int __attribute__((ext_vector_type(4))) int4;
-
-/*
- * long2: Two 64 bit signed integers
- *
- * Vector version of the basic long type. Provides two long fields packed into a
- * single 128 bit field with 128 bit alignment.
- */
-typedef long __attribute__((ext_vector_type(2))) long2;
-
-/*
- * long3: Three 64 bit signed integers
- *
- * Vector version of the basic long type. Provides three long fields packed into
- * a single 256 bit field with 256 bit alignment.
- */
-typedef long __attribute__((ext_vector_type(3))) long3;
-
-/*
- * long4: Four 64 bit signed integers
- *
- * Vector version of the basic long type. Provides four long fields packed into
- * a single 256 bit field with 256 bit alignment.
- */
-typedef long __attribute__((ext_vector_type(4))) long4;
-
-/*
- * rs_matrix4x4: 4x4 matrix of 32 bit floats
- *
- * Native holder for RS matrix. Elements are stored in the array at the
- * location [row*4 + col]
- */
-typedef struct {
- float m[16];
-} rs_matrix4x4;
-
-/*
- * rs_matrix3x3: 3x3 matrix of 32 bit floats
- *
- * Native holder for RS matrix. Elements are stored in the array at the
- * location [row*3 + col]
- */
-typedef struct {
- float m[9];
-} rs_matrix3x3;
-
-/*
- * rs_matrix2x2: 2x2 matrix of 32 bit floats
- *
- * Native holder for RS matrix. Elements are stored in the array at the
- * location [row*2 + col]
- */
-typedef struct {
- float m[4];
-} rs_matrix2x2;
-
-/*
- * rs_quaternion: Quarternion
- *
- * Quaternion type for use with the quaternion functions
- */
-typedef float4 rs_quaternion;
-
-/*
- * rs_allocation_cubemap_face: Enum for selecting cube map faces
- *
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
-typedef enum {
- RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
- RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
- RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
- RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
- RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
- RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
-} rs_allocation_cubemap_face;
-#endif
-
-/*
- * rs_allocation_usage_type: Bitfield to specify the usage types for an allocation
- *
- * These values are ORed together to specify which usages or memory spaces are
- * relevant to an allocation or an operation on an allocation.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
-typedef enum {
- RS_ALLOCATION_USAGE_SCRIPT = 0x0001,
- RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, // Deprecated.
- RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, // Deprecated.
- RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, // Deprecated.
- RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010 // Deprecated.
-} rs_allocation_usage_type;
-#endif
-
-/*
- * rs_primitive: How to intepret mesh vertex data
- *
- * Describes the way mesh vertex data is interpreted when rendering
- */
-#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
- RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
- RS_PRIMITIVE_LINE_STRIP = 2, // Vertex data will be rendered as a connected line strip
- RS_PRIMITIVE_TRIANGLE = 3, // Vertices will be rendered as individual triangles
- RS_PRIMITIVE_TRIANGLE_STRIP = 4, // Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex
- RS_PRIMITIVE_TRIANGLE_FAN = 5, // Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
- RS_PRIMITIVE_INVALID = 100 // Invalid primitive
-} rs_primitive;
-#endif
-#endif
-
-/*
- * rs_data_type: Element data types
- *
- * DataType represents the basic type information for a basic element. The
- * naming convention follows. For numeric types it is FLOAT,
- * SIGNED, or UNSIGNED followed by the _BITS where BITS is the
- * size of the data. BOOLEAN is a true / false (1,0)
- * represented in an 8 bit container. The UNSIGNED variants
- * with multiple bit definitions are for packed graphical data
- * formats and represent vectors with per vector member sizes
- * which are treated as a single unit for packing and alignment
- * purposes.
- *
- * MATRIX the three matrix types contain FLOAT_32 elements and are treated
- * as 32 bits for alignment purposes.
- *
- * RS_* objects. 32 bit opaque handles.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_TYPE_NONE = 0,
- RS_TYPE_FLOAT_32 = 2,
- RS_TYPE_FLOAT_64 = 3,
- RS_TYPE_SIGNED_8 = 4,
- RS_TYPE_SIGNED_16 = 5,
- RS_TYPE_SIGNED_32 = 6,
- RS_TYPE_SIGNED_64 = 7,
- RS_TYPE_UNSIGNED_8 = 8,
- RS_TYPE_UNSIGNED_16 = 9,
- RS_TYPE_UNSIGNED_32 = 10,
- RS_TYPE_UNSIGNED_64 = 11,
- RS_TYPE_BOOLEAN = 12,
- RS_TYPE_UNSIGNED_5_6_5 = 13,
- RS_TYPE_UNSIGNED_5_5_5_1 = 14,
- RS_TYPE_UNSIGNED_4_4_4_4 = 15,
- RS_TYPE_MATRIX_4X4 = 16,
- RS_TYPE_MATRIX_3X3 = 17,
- RS_TYPE_MATRIX_2X2 = 18,
- RS_TYPE_ELEMENT = 1000,
- RS_TYPE_TYPE = 1001,
- RS_TYPE_ALLOCATION = 1002,
- RS_TYPE_SAMPLER = 1003,
- RS_TYPE_SCRIPT = 1004,
- RS_TYPE_MESH = 1005,
- RS_TYPE_PROGRAM_FRAGMENT = 1006,
- RS_TYPE_PROGRAM_VERTEX = 1007,
- RS_TYPE_PROGRAM_RASTER = 1008,
- RS_TYPE_PROGRAM_STORE = 1009,
- RS_TYPE_FONT = 1010,
- RS_TYPE_INVALID = 10000
-} rs_data_type;
-#endif
-
-/*
- * rs_data_kind: Element data kind
- *
- * The special interpretation of the data if required. This is primarly
- * useful for graphical data. USER indicates no special interpretation is
- * expected. PIXEL is used in conjunction with the standard data types for
- * representing texture formats.
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_KIND_USER = 0,
- RS_KIND_PIXEL_L = 7,
- RS_KIND_PIXEL_A = 8,
- RS_KIND_PIXEL_LA = 9,
- RS_KIND_PIXEL_RGB = 10,
- RS_KIND_PIXEL_RGBA = 11,
- RS_KIND_PIXEL_DEPTH = 12,
- RS_KIND_PIXEL_YUV = 13,
- RS_KIND_INVALID = 100
-} rs_data_kind;
-#endif
-
-/*
- * rs_depth_func: Depth function
- *
- * Specifies conditional drawing depending on the comparison of the incoming
- * depth to that found in the depth buffer.
- */
-#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
- RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
- RS_DEPTH_FUNC_LEQUAL = 2, // Drawn if the incoming depth value is less or equal to that in the depth buffer
- RS_DEPTH_FUNC_GREATER = 3, // Drawn if the incoming depth value is greater than that in the depth buffer
- RS_DEPTH_FUNC_GEQUAL = 4, // Drawn if the incoming depth value is greater or equal to that in the depth buffer
- RS_DEPTH_FUNC_EQUAL = 5, // Drawn if the incoming depth value is equal to that in the depth buffer
- RS_DEPTH_FUNC_NOTEQUAL = 6, // Drawn if the incoming depth value is not equal to that in the depth buffer
- RS_DEPTH_FUNC_INVALID = 100 // Invalid depth function
-} rs_depth_func;
-#endif
-#endif
-
-/*
- * rs_blend_src_func: Blend source function
- *
- */
-#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_BLEND_SRC_ZERO = 0,
- RS_BLEND_SRC_ONE = 1,
- RS_BLEND_SRC_DST_COLOR = 2,
- RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3,
- RS_BLEND_SRC_SRC_ALPHA = 4,
- RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5,
- RS_BLEND_SRC_DST_ALPHA = 6,
- RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7,
- RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8,
- RS_BLEND_SRC_INVALID = 100
-} rs_blend_src_func;
-#endif
-#endif
-
-/*
- * rs_blend_dst_func: Blend destination function
- *
- */
-#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_BLEND_DST_ZERO = 0,
- RS_BLEND_DST_ONE = 1,
- RS_BLEND_DST_SRC_COLOR = 2,
- RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3,
- RS_BLEND_DST_SRC_ALPHA = 4,
- RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5,
- RS_BLEND_DST_DST_ALPHA = 6,
- RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7,
- RS_BLEND_DST_INVALID = 100
-} rs_blend_dst_func;
-#endif
-#endif
-
-/*
- * rs_cull_mode: Culling mode
- *
- */
-#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_CULL_BACK = 0,
- RS_CULL_FRONT = 1,
- RS_CULL_NONE = 2,
- RS_CULL_INVALID = 100
-} rs_cull_mode;
-#endif
-#endif
-
-/*
- * rs_sampler_value: Sampler wrap T value
- *
- */
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
-typedef enum {
- RS_SAMPLER_NEAREST = 0,
- RS_SAMPLER_LINEAR = 1,
- RS_SAMPLER_LINEAR_MIP_LINEAR = 2,
- RS_SAMPLER_WRAP = 3,
- RS_SAMPLER_CLAMP = 4,
- RS_SAMPLER_LINEAR_MIP_NEAREST = 5,
- RS_SAMPLER_MIRRORED_REPEAT = 6,
- RS_SAMPLER_INVALID = 100
-} rs_sampler_value;
-#endif
-
-#endif // RENDERSCRIPT_RS_TYPES_RSH
diff --git a/renderscript/include/rs_value_types.rsh b/renderscript/include/rs_value_types.rsh
new file mode 100644
index 0000000..c19bd4e
--- /dev/null
+++ b/renderscript/include/rs_value_types.rsh
@@ -0,0 +1,405 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_value_types.rsh: Standard RenderScript types
+ *
+ * Integers:
+ * 8 bit: char, int8_t
+ * 16 bit: short, int16_t
+ * 32 bit: int, in32_t
+ * 64 bit: long, long long, int64_t
+ *
+ * Unsigned integers:
+ * 8 bit: uchar, uint8_t
+ * 16 bit: ushort, uint16_t
+ * 32 bit: uint, uint32_t
+ * 64 bit: ulong, uint64_t
+ *
+ * Floating point:
+ * 32 bit: float
+ * 64 bit: double
+ *
+ * Vectors of length 2, 3, and 4 are supported for all the types above.
+ */
+#ifndef RENDERSCRIPT_RS_VALUE_TYPES_RSH
+#define RENDERSCRIPT_RS_VALUE_TYPES_RSH
+
+/*
+ * int8_t: 8 bit signed integer
+ *
+ * 8 bit integer type
+ */
+typedef char int8_t;
+
+/*
+ * int16_t: 16 bit signed integer
+ *
+ * 16 bit integer type
+ */
+typedef short int16_t;
+
+/*
+ * int32_t: 32 bit signed integer
+ *
+ * 32 bit integer type
+ */
+typedef int int32_t;
+
+/*
+ * int64_t: 64 bit signed integer
+ *
+ * 64 bit integer type
+ */
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+typedef long long int64_t;
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+typedef long int64_t;
+#endif
+
+/*
+ * uint8_t: 8 bit unsigned integer
+ *
+ * 8 bit unsigned integer type
+ */
+typedef unsigned char uint8_t;
+
+/*
+ * uint16_t: 16 bit unsigned integer
+ *
+ * 16 bit unsigned integer type
+ */
+typedef unsigned short uint16_t;
+
+/*
+ * uint32_t: 32 bit unsigned integer
+ *
+ * 32 bit unsigned integer type
+ */
+typedef unsigned int uint32_t;
+
+/*
+ * uint64_t: 64 bit unsigned integer
+ *
+ * 64 bit unsigned integer type
+ */
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+typedef unsigned long long uint64_t;
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+typedef unsigned long uint64_t;
+#endif
+
+/*
+ * uchar: 8 bit unsigned integer
+ *
+ * 8 bit unsigned integer type
+ */
+typedef uint8_t uchar;
+
+/*
+ * ushort: 16 bit unsigned integer
+ *
+ * 16 bit unsigned integer type
+ */
+typedef uint16_t ushort;
+
+/*
+ * uint: 32 bit unsigned integer
+ *
+ * 32 bit unsigned integer type
+ */
+typedef uint32_t uint;
+
+/*
+ * ulong: 64 bit unsigned integer
+ *
+ * Typedef for unsigned long (use for 64-bit unsigned integers)
+ */
+typedef uint64_t ulong;
+
+/*
+ * size_t: Unsigned size type
+ *
+ * Typedef for size_t
+ */
+#ifdef __LP64__
+typedef uint64_t size_t;
+#endif
+
+#ifndef __LP64__
+typedef uint32_t size_t;
+#endif
+
+/*
+ * ssize_t: Signed size type
+ *
+ * Typedef for ssize_t
+ */
+#ifdef __LP64__
+typedef int64_t ssize_t;
+#endif
+
+#ifndef __LP64__
+typedef int32_t ssize_t;
+#endif
+
+/*
+ * float2: Two 32 bit floats
+ *
+ * Vector version of the basic float type.
+ * Provides two float fields packed into a single 64 bit field with 64 bit alignment.
+ */
+typedef float __attribute__((ext_vector_type(2))) float2;
+
+/*
+ * float3: Three 32 bit floats
+ *
+ * Vector version of the basic float type.
+ * Provides three float fields packed into a single 128 bit field with 128 bit alignment.
+ */
+typedef float __attribute__((ext_vector_type(3))) float3;
+
+/*
+ * float4: Four 32 bit floats
+ *
+ * Vector version of the basic float type.
+ * Provides four float fields packed into a single 128 bit field with 128 bit alignment.
+ */
+typedef float __attribute__((ext_vector_type(4))) float4;
+
+/*
+ * double2: Two 64 bit floats
+ *
+ * Vector version of the basic double type. Provides two double fields packed
+ * into a single 128 bit field with 128 bit alignment.
+ */
+typedef double __attribute__((ext_vector_type(2))) double2;
+
+/*
+ * double3: Three 64 bit floats
+ *
+ * Vector version of the basic double type. Provides three double fields packed
+ * into a single 256 bit field with 256 bit alignment.
+ */
+typedef double __attribute__((ext_vector_type(3))) double3;
+
+/*
+ * double4: Four 64 bit floats
+ *
+ * Vector version of the basic double type. Provides four double fields packed
+ * into a single 256 bit field with 256 bit alignment.
+ */
+typedef double __attribute__((ext_vector_type(4))) double4;
+
+/*
+ * uchar2: Two 8 bit unsigned integers
+ *
+ * Vector version of the basic uchar type. Provides two uchar fields packed
+ * into a single 16 bit field with 16 bit alignment.
+ */
+typedef uchar __attribute__((ext_vector_type(2))) uchar2;
+
+/*
+ * uchar3: Three 8 bit unsigned integers
+ *
+ * Vector version of the basic uchar type. Provides three uchar fields packed
+ * into a single 32 bit field with 32 bit alignment.
+ */
+typedef uchar __attribute__((ext_vector_type(3))) uchar3;
+
+/*
+ * uchar4: Four 8 bit unsigned integers
+ *
+ * Vector version of the basic uchar type. Provides four uchar fields packed
+ * into a single 32 bit field with 32 bit alignment.
+ */
+typedef uchar __attribute__((ext_vector_type(4))) uchar4;
+
+/*
+ * ushort2: Two 16 bit unsigned integers
+ *
+ * Vector version of the basic ushort type. Provides two ushort fields packed
+ * into a single 32 bit field with 32 bit alignment.
+ */
+typedef ushort __attribute__((ext_vector_type(2))) ushort2;
+
+/*
+ * ushort3: Three 16 bit unsigned integers
+ *
+ * Vector version of the basic ushort type. Provides three ushort fields packed
+ * into a single 64 bit field with 64 bit alignment.
+ */
+typedef ushort __attribute__((ext_vector_type(3))) ushort3;
+
+/*
+ * ushort4: Four 16 bit unsigned integers
+ *
+ * Vector version of the basic ushort type. Provides four ushort fields packed
+ * into a single 64 bit field with 64 bit alignment.
+ */
+typedef ushort __attribute__((ext_vector_type(4))) ushort4;
+
+/*
+ * uint2: Two 32 bit unsigned integers
+ *
+ * Vector version of the basic uint type. Provides two uint fields packed into a
+ * single 64 bit field with 64 bit alignment.
+ */
+typedef uint __attribute__((ext_vector_type(2))) uint2;
+
+/*
+ * uint3: Three 32 bit unsigned integers
+ *
+ * Vector version of the basic uint type. Provides three uint fields packed into
+ * a single 128 bit field with 128 bit alignment.
+ */
+typedef uint __attribute__((ext_vector_type(3))) uint3;
+
+/*
+ * uint4: Four 32 bit unsigned integers
+ *
+ * Vector version of the basic uint type. Provides four uint fields packed into
+ * a single 128 bit field with 128 bit alignment.
+ */
+typedef uint __attribute__((ext_vector_type(4))) uint4;
+
+/*
+ * ulong2: Two 64 bit unsigned integers
+ *
+ * Vector version of the basic ulong type. Provides two ulong fields packed into
+ * a single 128 bit field with 128 bit alignment.
+ */
+typedef ulong __attribute__((ext_vector_type(2))) ulong2;
+
+/*
+ * ulong3: Three 64 bit unsigned integers
+ *
+ * Vector version of the basic ulong type. Provides three ulong fields packed
+ * into a single 256 bit field with 256 bit alignment.
+ */
+typedef ulong __attribute__((ext_vector_type(3))) ulong3;
+
+/*
+ * ulong4: Four 64 bit unsigned integers
+ *
+ * Vector version of the basic ulong type. Provides four ulong fields packed
+ * into a single 256 bit field with 256 bit alignment.
+ */
+typedef ulong __attribute__((ext_vector_type(4))) ulong4;
+
+/*
+ * char2: Two 8 bit signed integers
+ *
+ * Vector version of the basic char type. Provides two char fields packed into a
+ * single 16 bit field with 16 bit alignment.
+ */
+typedef char __attribute__((ext_vector_type(2))) char2;
+
+/*
+ * char3: Three 8 bit signed integers
+ *
+ * Vector version of the basic char type. Provides three char fields packed into
+ * a single 32 bit field with 32 bit alignment.
+ */
+typedef char __attribute__((ext_vector_type(3))) char3;
+
+/*
+ * char4: Four 8 bit signed integers
+ *
+ * Vector version of the basic char type. Provides four char fields packed into
+ * a single 32 bit field with 32 bit alignment.
+ */
+typedef char __attribute__((ext_vector_type(4))) char4;
+
+/*
+ * short2: Two 16 bit signed integers
+ *
+ * Vector version of the basic short type. Provides two short fields packed into
+ * a single 32 bit field with 32 bit alignment.
+ */
+typedef short __attribute__((ext_vector_type(2))) short2;
+
+/*
+ * short3: Three 16 bit signed integers
+ *
+ * Vector version of the basic short type. Provides three short fields packed
+ * into a single 64 bit field with 64 bit alignment.
+ */
+typedef short __attribute__((ext_vector_type(3))) short3;
+
+/*
+ * short4: Four 16 bit signed integers
+ *
+ * Vector version of the basic short type. Provides four short fields packed
+ * into a single 64 bit field with 64 bit alignment.
+ */
+typedef short __attribute__((ext_vector_type(4))) short4;
+
+/*
+ * int2: Two 32 bit signed integers
+ *
+ * Vector version of the basic int type. Provides two int fields packed into a
+ * single 64 bit field with 64 bit alignment.
+ */
+typedef int __attribute__((ext_vector_type(2))) int2;
+
+/*
+ * int3: Three 32 bit signed integers
+ *
+ * Vector version of the basic int type. Provides three int fields packed into a
+ * single 128 bit field with 128 bit alignment.
+ */
+typedef int __attribute__((ext_vector_type(3))) int3;
+
+/*
+ * int4: Four 32 bit signed integers
+ *
+ * Vector version of the basic int type. Provides two four fields packed into a
+ * single 128 bit field with 128 bit alignment.
+ */
+typedef int __attribute__((ext_vector_type(4))) int4;
+
+/*
+ * long2: Two 64 bit signed integers
+ *
+ * Vector version of the basic long type. Provides two long fields packed into a
+ * single 128 bit field with 128 bit alignment.
+ */
+typedef long __attribute__((ext_vector_type(2))) long2;
+
+/*
+ * long3: Three 64 bit signed integers
+ *
+ * Vector version of the basic long type. Provides three long fields packed into
+ * a single 256 bit field with 256 bit alignment.
+ */
+typedef long __attribute__((ext_vector_type(3))) long3;
+
+/*
+ * long4: Four 64 bit signed integers
+ *
+ * Vector version of the basic long type. Provides four long fields packed into
+ * a single 256 bit field with 256 bit alignment.
+ */
+typedef long __attribute__((ext_vector_type(4))) long4;
+
+#endif // RENDERSCRIPT_RS_VALUE_TYPES_RSH
diff --git a/renderscript/include/rs_vector_math.rsh b/renderscript/include/rs_vector_math.rsh
new file mode 100644
index 0000000..d82cd69
--- /dev/null
+++ b/renderscript/include/rs_vector_math.rsh
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+/*
+ * rs_vector_math.rsh: TODO Add documentation
+ *
+ * TODO Add documentation
+ */
+#ifndef RENDERSCRIPT_RS_VECTOR_MATH_RSH
+#define RENDERSCRIPT_RS_VECTOR_MATH_RSH
+
+/*
+ * cross: Cross product of two vectors
+ *
+ * Computes the cross product of two vectors.
+ */
+extern float3 __attribute__((const, overloadable))
+ cross(float3 left_vector, float3 right_vector);
+
+extern float4 __attribute__((const, overloadable))
+ cross(float4 left_vector, float4 right_vector);
+
+/*
+ * distance: Distance between two points
+ *
+ * Compute the distance between two points.
+ *
+ * See also fast_distance(), native_distance().
+ */
+extern float __attribute__((const, overloadable))
+ distance(float left_vector, float right_vector);
+
+extern float __attribute__((const, overloadable))
+ distance(float2 left_vector, float2 right_vector);
+
+extern float __attribute__((const, overloadable))
+ distance(float3 left_vector, float3 right_vector);
+
+extern float __attribute__((const, overloadable))
+ distance(float4 left_vector, float4 right_vector);
+
+/*
+ * dot: Dot product of two vectors
+ *
+ * Computes the dot product of two vectors.
+ */
+extern float __attribute__((const, overloadable))
+ dot(float left_vector, float right_vector);
+
+extern float __attribute__((const, overloadable))
+ dot(float2 left_vector, float2 right_vector);
+
+extern float __attribute__((const, overloadable))
+ dot(float3 left_vector, float3 right_vector);
+
+extern float __attribute__((const, overloadable))
+ dot(float4 left_vector, float4 right_vector);
+
+/*
+ * fast_distance: Approximate distance between two points
+ *
+ * Computes the approximate distance between two points.
+ *
+ * The precision is what would be expected from doing the computation using 16 bit floating point values.
+ *
+ * See also distance(), native_distance().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_distance(float left_vector, float right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_distance(float2 left_vector, float2 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_distance(float3 left_vector, float3 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_distance(float4 left_vector, float4 right_vector);
+#endif
+
+/*
+ * fast_length: Approximate length of a vector
+ *
+ * Computes the approximate length of a vector.
+ *
+ * The precision is what would be expected from doing the computation using 16 bit floating point values.
+ *
+ * See also length(), native_length().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_length(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_length(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_length(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_length(float4 v);
+#endif
+
+/*
+ * fast_normalize: Approximate normalized vector
+ *
+ * Approximately normalizes a vector.
+ *
+ * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
+ *
+ * The precision is what would be expected from doing the computation using 16 bit floating point values.
+ *
+ * See also normalize(), native_normalize().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ fast_normalize(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ fast_normalize(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ fast_normalize(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ fast_normalize(float4 v);
+#endif
+
+/*
+ * length: Length of a vector
+ *
+ * Computes the length of a vector.
+ *
+ * See also fast_length(), native_length().
+ */
+extern float __attribute__((const, overloadable))
+ length(float v);
+
+extern float __attribute__((const, overloadable))
+ length(float2 v);
+
+extern float __attribute__((const, overloadable))
+ length(float3 v);
+
+extern float __attribute__((const, overloadable))
+ length(float4 v);
+
+/*
+ * native_distance: Approximate distance between two points
+ *
+ * Computes the approximate distance between two points.
+ *
+ * See also distance(), fast_distance().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_distance(float left_vector, float right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_distance(float2 left_vector, float2 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_distance(float3 left_vector, float3 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_distance(float4 left_vector, float4 right_vector);
+#endif
+
+/*
+ * native_length: Approximate length of a vector
+ *
+ * Compute the approximate length of a vector.
+ *
+ * See also length(), fast_length().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_length(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_length(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_length(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_length(float4 v);
+#endif
+
+/*
+ * native_normalize: Approximately normalize a vector
+ *
+ * Approximately normalizes a vector.
+ *
+ * See also normalize(), fast_normalize().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_normalize(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_normalize(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_normalize(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_normalize(float4 v);
+#endif
+
+/*
+ * normalize: Normalize a vector
+ *
+ * Normalize a vector.
+ *
+ * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
+ *
+ * See also fast_normalize(), native_normalize().
+ */
+extern float __attribute__((const, overloadable))
+ normalize(float v);
+
+extern float2 __attribute__((const, overloadable))
+ normalize(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ normalize(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ normalize(float4 v);
+
+#endif // RENDERSCRIPT_RS_VECTOR_MATH_RSH
diff --git a/renderscript/include/rs_vp9.rsh b/renderscript/include/rs_vp9.rsh
deleted file mode 100644
index 52fbe81..0000000
--- a/renderscript/include/rs_vp9.rsh
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-
-#ifndef __RS_VP9_RSH__
-#define __RS_VP9_RSH__
-
-
-#include "rs_idct.rsh"
-#include "rs_dct.rsh"
-#include "rs_iadst.rsh"
-#include "rs_fadst.rsh"
-#include "rs_walsh.rsh"
-
-#endif
-
diff --git a/renderscript/include/rs_walsh.rsh b/renderscript/include/rs_walsh.rsh
deleted file mode 100644
index 6f7445d..0000000
--- a/renderscript/include/rs_walsh.rsh
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __RS_WALSH_RSH__
-#define __RS_WALSH_RSH__
-
-#if RS_VERSION > 19
-
-extern void rsWalsh4x4(rs_allocation input, rs_allocation dest, int xoff, int yoff);
-extern void rsWalsh4x4_1(rs_allocation input, rs_allocation dest, int xoff, int yoff);
-
-#endif
-
-#endif
diff --git a/renderscript/lib/arm/libRSSupport.so b/renderscript/lib/arm/libRSSupport.so
index 86f8f78..69399f2 100755
--- a/renderscript/lib/arm/libRSSupport.so
+++ b/renderscript/lib/arm/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/arm/libRSSupportIO.so b/renderscript/lib/arm/libRSSupportIO.so
index ed18c45..f2c4496 100755
--- a/renderscript/lib/arm/libRSSupportIO.so
+++ b/renderscript/lib/arm/libRSSupportIO.so
Binary files differ
diff --git a/renderscript/lib/arm/libc.so b/renderscript/lib/arm/libc.so
index f068f81..4630fed 100755
--- a/renderscript/lib/arm/libc.so
+++ b/renderscript/lib/arm/libc.so
Binary files differ
diff --git a/renderscript/lib/arm/libclcore.bc b/renderscript/lib/arm/libclcore.bc
index d57ddea..0e7afaf 100644
--- a/renderscript/lib/arm/libclcore.bc
+++ b/renderscript/lib/arm/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/arm/libm.so b/renderscript/lib/arm/libm.so
index 13fd827..567ee8b 100755
--- a/renderscript/lib/arm/libm.so
+++ b/renderscript/lib/arm/libm.so
Binary files differ
diff --git a/renderscript/lib/arm/librsjni.so b/renderscript/lib/arm/librsjni.so
index 2094b6a..e2f03d7 100755
--- a/renderscript/lib/arm/librsjni.so
+++ b/renderscript/lib/arm/librsjni.so
Binary files differ
diff --git a/renderscript/lib/arm/librsrt_arm.bc b/renderscript/lib/arm/librsrt_arm.bc
index d57ddea..0e7afaf 100644
--- a/renderscript/lib/arm/librsrt_arm.bc
+++ b/renderscript/lib/arm/librsrt_arm.bc
Binary files differ
diff --git a/renderscript/lib/javalib.jar b/renderscript/lib/javalib.jar
index 9e90b85..7d7faf2 100644
--- a/renderscript/lib/javalib.jar
+++ b/renderscript/lib/javalib.jar
Binary files differ
diff --git a/renderscript/lib/mips/libRSSupport.so b/renderscript/lib/mips/libRSSupport.so
index 30476e7..4960b22 100755
--- a/renderscript/lib/mips/libRSSupport.so
+++ b/renderscript/lib/mips/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/mips/libRSSupportIO.so b/renderscript/lib/mips/libRSSupportIO.so
index 19265e0..b58abe0 100755
--- a/renderscript/lib/mips/libRSSupportIO.so
+++ b/renderscript/lib/mips/libRSSupportIO.so
Binary files differ
diff --git a/renderscript/lib/mips/libc.so b/renderscript/lib/mips/libc.so
index 020a5f6..c5f2700 100755
--- a/renderscript/lib/mips/libc.so
+++ b/renderscript/lib/mips/libc.so
Binary files differ
diff --git a/renderscript/lib/mips/libclcore.bc b/renderscript/lib/mips/libclcore.bc
index d57ddea..0e7afaf 100644
--- a/renderscript/lib/mips/libclcore.bc
+++ b/renderscript/lib/mips/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/mips/libm.so b/renderscript/lib/mips/libm.so
index 62a9a85..19f1fe6 100755
--- a/renderscript/lib/mips/libm.so
+++ b/renderscript/lib/mips/libm.so
Binary files differ
diff --git a/renderscript/lib/mips/librsjni.so b/renderscript/lib/mips/librsjni.so
index bf8f269..e5a42b9 100755
--- a/renderscript/lib/mips/librsjni.so
+++ b/renderscript/lib/mips/librsjni.so
Binary files differ
diff --git a/renderscript/lib/mips/librsrt_mips.bc b/renderscript/lib/mips/librsrt_mips.bc
index d57ddea..0e7afaf 100644
--- a/renderscript/lib/mips/librsrt_mips.bc
+++ b/renderscript/lib/mips/librsrt_mips.bc
Binary files differ
diff --git a/renderscript/lib/x86/libRSSupport.so b/renderscript/lib/x86/libRSSupport.so
index 0bdf71e..10c77fb 100755
--- a/renderscript/lib/x86/libRSSupport.so
+++ b/renderscript/lib/x86/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/x86/libRSSupportIO.so b/renderscript/lib/x86/libRSSupportIO.so
index 57142d1..51bc4ea 100755
--- a/renderscript/lib/x86/libRSSupportIO.so
+++ b/renderscript/lib/x86/libRSSupportIO.so
Binary files differ
diff --git a/renderscript/lib/x86/libc.so b/renderscript/lib/x86/libc.so
index 7610b94..3168297 100755
--- a/renderscript/lib/x86/libc.so
+++ b/renderscript/lib/x86/libc.so
Binary files differ
diff --git a/renderscript/lib/x86/libclcore.bc b/renderscript/lib/x86/libclcore.bc
index c93cb71..3e2cbe6 100644
--- a/renderscript/lib/x86/libclcore.bc
+++ b/renderscript/lib/x86/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/x86/libm.so b/renderscript/lib/x86/libm.so
index ce846a2..b08788c 100755
--- a/renderscript/lib/x86/libm.so
+++ b/renderscript/lib/x86/libm.so
Binary files differ
diff --git a/renderscript/lib/x86/librsjni.so b/renderscript/lib/x86/librsjni.so
index c95532f..ee64320 100755
--- a/renderscript/lib/x86/librsjni.so
+++ b/renderscript/lib/x86/librsjni.so
Binary files differ
diff --git a/renderscript/lib/x86/librsrt_x86.bc b/renderscript/lib/x86/librsrt_x86.bc
index c643494..88e6b67 100644
--- a/renderscript/lib/x86/librsrt_x86.bc
+++ b/renderscript/lib/x86/librsrt_x86.bc
Binary files differ