blob: b17493317fe714cf34070a47aee1aad97e59c9bb [file] [log] [blame]
Jason Sams044e2ee2011-08-08 16:52:30 -07001/*
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07002 * Copyright (C) 2015 The Android Open Source Project
Jason Sams044e2ee2011-08-08 16:52:30 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070017// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
18
19/*
20 * rs_types.rsh: Standard RenderScript types
Jason Sams9df3b2b2011-08-08 14:31:25 -070021 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070022 * Integers:
Jason Sams9df3b2b2011-08-08 14:31:25 -070023 * 8 bit: char, int8_t
24 * 16 bit: short, int16_t
25 * 32 bit: int, in32_t
26 * 64 bit: long, long long, int64_t
27 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070028 * Unsigned integers:
Jason Sams9df3b2b2011-08-08 14:31:25 -070029 * 8 bit: uchar, uint8_t
30 * 16 bit: ushort, uint16_t
31 * 32 bit: uint, uint32_t
32 * 64 bit: ulong, uint64_t
33 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070034 * Floating point:
Jason Sams9df3b2b2011-08-08 14:31:25 -070035 * 32 bit: float
36 * 64 bit: double
37 *
38 * Vectors of length 2, 3, and 4 are supported for all the types above.
Jason Sams9df3b2b2011-08-08 14:31:25 -070039 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070040#ifndef RENDERSCRIPT_RS_TYPES_RSH
41#define RENDERSCRIPT_RS_TYPES_RSH
Rajeev Sharma75398202012-07-24 16:36:14 -070042
Shih-wei Liaoed2ea272011-01-19 12:17:54 -080043#include "stdbool.h"
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070044
45#define RS_PACKED __attribute__((packed, aligned(4)))
46#define NULL ((void *)0)
47
48// Opaque handle to a RenderScript object. Do not use this directly.
49#ifndef __LP64__
50#define _RS_HANDLE \
51struct {\
52 const int* const p;\
53} __attribute__((packed, aligned(4)))
54#else
55#define _RS_HANDLE \
56struct {\
57 const long* const p;\
58 const long* const r;\
59 const long* const v1;\
60 const long* const v2;\
61}
62#endif
63
64/*
65 * M_1_PI: 1 / pi, as a 32 bit float
66 *
67 * The inverse of pi, as a 32 bit float.
68 */
69#define M_1_PI 0.318309886183790671537767526745028724f
70
71/*
72 * M_2_PI: 2 / pi, as a 32 bit float
73 *
74 * 2 divided by pi, as a 32 bit float.
75 */
76#define M_2_PI 0.636619772367581343075535053490057448f
77
78/*
79 * M_2_PIl: Deprecated. Use M_2_PI instead.
80 *
81 */
82#define M_2_PIl 0.636619772367581343075535053490057448f
83
84/*
85 * M_2_SQRTPI: 2 / sqrt(pi), as a 32 bit float
86 *
87 * 2 divided by the square root of pi, as a 32 bit float.
88 */
89#define M_2_SQRTPI 1.128379167095512573896158903121545172f
90
91/*
92 * M_E: e, as a 32 bit float
93 *
94 * The number e, the base of the natural logarithm, as a 32 bit float.
95 */
96#define M_E 2.718281828459045235360287471352662498f
97
98/*
99 * M_LN10: log_e(10), as a 32 bit float
100 *
101 * The natural logarithm of 10, as a 32 bit float.
102 */
103#define M_LN10 2.302585092994045684017991454684364208f
104
105/*
106 * M_LN2: log_e(2), as a 32 bit float
107 *
108 * The natural logarithm of 2, as a 32 bit float.
109 */
110#define M_LN2 0.693147180559945309417232121458176568f
111
112/*
113 * M_LOG10E: log_10(e), as a 32 bit float
114 *
115 * The logarithm base 10 of e, as a 32 bit float.
116 */
117#define M_LOG10E 0.434294481903251827651128918916605082f
118
119/*
120 * M_LOG2E: log_2(e), as a 32 bit float
121 *
122 * The logarithm base 2 of e, as a 32 bit float.
123 */
124#define M_LOG2E 1.442695040888963407359924681001892137f
125
126/*
127 * M_PI: pi, as a 32 bit float
128 *
129 * The constant pi, as a 32 bit float.
130 */
131#define M_PI 3.141592653589793238462643383279502884f
132
133/*
134 * M_PI_2: pi / 2, as a 32 bit float
135 *
136 * Pi divided by 2, as a 32 bit float.
137 */
138#define M_PI_2 1.570796326794896619231321691639751442f
139
140/*
141 * M_PI_4: pi / 4, as a 32 bit float
142 *
143 * Pi divided by 4, as a 32 bit float.
144 */
145#define M_PI_4 0.785398163397448309615660845819875721f
146
147/*
148 * M_SQRT1_2: 1 / sqrt(2), as a 32 bit float
149 *
150 * The inverse of the square root of 2, as a 32 bit float.
151 */
152#define M_SQRT1_2 0.707106781186547524400844362104849039f
153
154/*
155 * M_SQRT2: sqrt(2), as a 32 bit float
156 *
157 * The square root of 2, as a 32 bit float.
158 */
159#define M_SQRT2 1.414213562373095048801688724209698079f
160
161/*
162 * int8_t: 8 bit signed integer
163 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700164 * 8 bit integer type
165 */
Jason Sams717e34a2010-03-16 15:35:57 -0700166typedef char int8_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700167
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700168/*
169 * int16_t: 16 bit signed integer
170 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700171 * 16 bit integer type
172 */
Jason Sams717e34a2010-03-16 15:35:57 -0700173typedef short int16_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700174
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700175/*
176 * int32_t: 32 bit signed integer
177 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700178 * 32 bit integer type
179 */
Jason Sams717e34a2010-03-16 15:35:57 -0700180typedef int int32_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700181
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700182/*
183 * int64_t: 64 bit signed integer
184 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700185 * 64 bit integer type
186 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700187#if !defined(RS_VERSION) || (RS_VERSION <= 20)
188typedef long long int64_t;
Jason Samsd8b8f8a2014-08-19 17:53:08 -0700189#endif
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700190
191#if (defined(RS_VERSION) && (RS_VERSION >= 21))
192typedef long int64_t;
193#endif
194
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700195/*
196 * uint8_t: 8 bit unsigned integer
197 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700198 * 8 bit unsigned integer type
199 */
Jason Sams717e34a2010-03-16 15:35:57 -0700200typedef unsigned char uint8_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700201
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700202/*
203 * uint16_t: 16 bit unsigned integer
204 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700205 * 16 bit unsigned integer type
206 */
Jason Sams717e34a2010-03-16 15:35:57 -0700207typedef unsigned short uint16_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700208
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700209/*
210 * uint32_t: 32 bit unsigned integer
211 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700212 * 32 bit unsigned integer type
213 */
Jason Sams717e34a2010-03-16 15:35:57 -0700214typedef unsigned int uint32_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700215
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700216/*
217 * uint64_t: 64 bit unsigned integer
218 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700219 * 64 bit unsigned integer type
220 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700221#if !defined(RS_VERSION) || (RS_VERSION <= 20)
222typedef unsigned long long uint64_t;
Jason Samsd8b8f8a2014-08-19 17:53:08 -0700223#endif
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700224
225#if (defined(RS_VERSION) && (RS_VERSION >= 21))
226typedef unsigned long uint64_t;
227#endif
228
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700229/*
230 * uchar: 8 bit unsigned integer
231 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700232 * 8 bit unsigned integer type
233 */
Jason Sams717e34a2010-03-16 15:35:57 -0700234typedef uint8_t uchar;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700235
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700236/*
237 * ushort: 16 bit unsigned integer
238 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700239 * 16 bit unsigned integer type
240 */
Jason Sams717e34a2010-03-16 15:35:57 -0700241typedef uint16_t ushort;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700242
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700243/*
244 * uint: 32 bit unsigned integer
245 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700246 * 32 bit unsigned integer type
247 */
Jason Sams717e34a2010-03-16 15:35:57 -0700248typedef uint32_t uint;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700249
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700250/*
251 * ulong: 64 bit unsigned integer
252 *
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700253 * Typedef for unsigned long (use for 64-bit unsigned integers)
Jason Sams9df3b2b2011-08-08 14:31:25 -0700254 */
Jason Sams22fa3712010-05-19 17:22:57 -0700255typedef uint64_t ulong;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700256
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700257/*
258 * size_t: Unsigned size type
259 *
Tim Murraye3af53b2014-06-10 09:46:51 -0700260 * Typedef for size_t
Jason Sams9df3b2b2011-08-08 14:31:25 -0700261 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700262#ifdef __LP64__
263typedef uint64_t size_t;
264#endif
265
Jason Sams3ff0fe72014-05-19 15:06:59 -0700266#ifndef __LP64__
Tim Murraye3af53b2014-06-10 09:46:51 -0700267typedef uint32_t size_t;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700268#endif
269
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700270/*
271 * ssize_t: Signed size type
272 *
273 * Typedef for ssize_t
274 */
275#ifdef __LP64__
Tim Murraye3af53b2014-06-10 09:46:51 -0700276typedef int64_t ssize_t;
Jason Sams3ff0fe72014-05-19 15:06:59 -0700277#endif
278
Tim Murrayfa6f90e2014-06-12 14:16:10 -0700279#ifndef __LP64__
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700280typedef int32_t ssize_t;
Tim Murrayfa6f90e2014-06-12 14:16:10 -0700281#endif
Tim Murraye3af53b2014-06-10 09:46:51 -0700282
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700283/*
284 * rs_element: Handle to an element
Jason Sams9df3b2b2011-08-08 14:31:25 -0700285 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700286 * Opaque handle to a RenderScript element.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700287 * See: android.renderscript.Element
288 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700289typedef _RS_HANDLE rs_element;
290
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700291/*
292 * rs_type: Handle to a Type
Jason Sams9df3b2b2011-08-08 14:31:25 -0700293 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700294 * Opaque handle to a RenderScript type.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700295 * See: android.renderscript.Type
296 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700297typedef _RS_HANDLE rs_type;
298
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700299/*
300 * rs_allocation: Handle to an allocation
Jason Sams9df3b2b2011-08-08 14:31:25 -0700301 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700302 * Opaque handle to a RenderScript allocation.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700303 * See: android.renderscript.Allocation
304 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700305typedef _RS_HANDLE rs_allocation;
306
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700307/*
308 * rs_sampler: Handle to a Sampler
Jason Sams9df3b2b2011-08-08 14:31:25 -0700309 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700310 * Opaque handle to a RenderScript sampler object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700311 * See: android.renderscript.Sampler
312 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700313typedef _RS_HANDLE rs_sampler;
314
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700315/*
316 * rs_script: Handle to a Script
Jason Sams9df3b2b2011-08-08 14:31:25 -0700317 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700318 * Opaque handle to a RenderScript script object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700319 * See: android.renderscript.ScriptC
320 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700321typedef _RS_HANDLE rs_script;
Jason Sams3ff0fe72014-05-19 15:06:59 -0700322
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700323/*
324 * rs_mesh: Handle to a Mesh
Jason Sams9df3b2b2011-08-08 14:31:25 -0700325 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700326 * Opaque handle to a RenderScript mesh object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700327 * See: android.renderscript.Mesh
328 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700329#ifndef __LP64__
330typedef _RS_HANDLE rs_mesh;
331#endif
332
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700333/*
334 * rs_program_fragment: Handle to a ProgramFragment
Jason Sams9e0afb52011-10-31 13:23:43 -0700335 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700336 * Opaque handle to a RenderScript ProgramFragment object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700337 * See: android.renderscript.ProgramFragment
338 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700339#ifndef __LP64__
340typedef _RS_HANDLE rs_program_fragment;
341#endif
342
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700343/*
344 * rs_program_vertex: Handle to a ProgramVertex
Jason Sams9df3b2b2011-08-08 14:31:25 -0700345 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700346 * Opaque handle to a RenderScript ProgramVertex object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700347 * See: android.renderscript.ProgramVertex
348 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700349#ifndef __LP64__
350typedef _RS_HANDLE rs_program_vertex;
351#endif
352
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700353/*
354 * rs_program_raster: Handle to a ProgramRaster
Jason Sams9df3b2b2011-08-08 14:31:25 -0700355 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700356 * Opaque handle to a RenderScript ProgramRaster object.
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700357 * See: android.renderscript.ProgramRaster
Jason Sams9df3b2b2011-08-08 14:31:25 -0700358 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700359#ifndef __LP64__
360typedef _RS_HANDLE rs_program_raster;
361#endif
362
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700363/*
364 * rs_program_store: Handle to a ProgramStore
Jason Sams9df3b2b2011-08-08 14:31:25 -0700365 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700366 * Opaque handle to a RenderScript ProgramStore object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700367 * See: android.renderscript.ProgramStore
368 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700369#ifndef __LP64__
370typedef _RS_HANDLE rs_program_store;
371#endif
372
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700373/*
374 * rs_font: Handle to a Font
Jason Sams9df3b2b2011-08-08 14:31:25 -0700375 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700376 * Opaque handle to a RenderScript font object.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700377 * See: android.renderscript.Font
378 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700379#ifndef __LP64__
380typedef _RS_HANDLE rs_font;
381#endif
Jason Samsc0936852010-08-16 12:41:48 -0700382
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700383/*
384 * float2: Two 32 bit floats
385 *
386 * Vector version of the basic float type.
387 * Provides two float fields packed into a single 64 bit field with 64 bit alignment.
388 */
389typedef float __attribute__((ext_vector_type(2))) float2;
390
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700391/*
392 * float3: Three 32 bit floats
393 *
394 * Vector version of the basic float type.
395 * Provides three float fields packed into a single 128 bit field with 128 bit alignment.
396 */
397typedef float __attribute__((ext_vector_type(3))) float3;
398
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700399/*
400 * float4: Four 32 bit floats
401 *
402 * Vector version of the basic float type.
403 * Provides four float fields packed into a single 128 bit field with 128 bit alignment.
404 */
405typedef float __attribute__((ext_vector_type(4))) float4;
406
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700407/*
408 * double2: Two 64 bit floats
409 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700410 * Vector version of the basic double type. Provides two double fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700411 * into a single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700412 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700413typedef double __attribute__((ext_vector_type(2))) double2;
414
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700415/*
416 * double3: Three 64 bit floats
417 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700418 * Vector version of the basic double type. Provides three double fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700419 * into a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700420 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700421typedef double __attribute__((ext_vector_type(3))) double3;
422
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700423/*
424 * double4: Four 64 bit floats
425 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700426 * Vector version of the basic double type. Provides four double fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700427 * into a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700428 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700429typedef double __attribute__((ext_vector_type(4))) double4;
Jason Sams46f2e722011-04-22 17:05:25 -0700430
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700431/*
432 * uchar2: Two 8 bit unsigned integers
433 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700434 * Vector version of the basic uchar type. Provides two uchar fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700435 * into a single 16 bit field with 16 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700436 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700437typedef uchar __attribute__((ext_vector_type(2))) uchar2;
438
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700439/*
440 * uchar3: Three 8 bit unsigned integers
441 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700442 * Vector version of the basic uchar type. Provides three uchar fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700443 * into a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700444 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700445typedef uchar __attribute__((ext_vector_type(3))) uchar3;
446
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700447/*
448 * uchar4: Four 8 bit unsigned integers
449 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700450 * Vector version of the basic uchar type. Provides four uchar fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700451 * into a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700452 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700453typedef uchar __attribute__((ext_vector_type(4))) uchar4;
Jason Sams717e34a2010-03-16 15:35:57 -0700454
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700455/*
456 * ushort2: Two 16 bit unsigned integers
457 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700458 * Vector version of the basic ushort type. Provides two ushort fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700459 * into a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700460 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700461typedef ushort __attribute__((ext_vector_type(2))) ushort2;
462
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700463/*
464 * ushort3: Three 16 bit unsigned integers
465 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700466 * Vector version of the basic ushort type. Provides three ushort fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700467 * into a single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700468 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700469typedef ushort __attribute__((ext_vector_type(3))) ushort3;
470
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700471/*
472 * ushort4: Four 16 bit unsigned integers
473 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700474 * Vector version of the basic ushort type. Provides four ushort fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700475 * into a single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700476 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700477typedef ushort __attribute__((ext_vector_type(4))) ushort4;
Jason Sams717e34a2010-03-16 15:35:57 -0700478
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700479/*
480 * uint2: Two 32 bit unsigned integers
481 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700482 * Vector version of the basic uint type. Provides two uint fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700483 * single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700484 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700485typedef uint __attribute__((ext_vector_type(2))) uint2;
486
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700487/*
488 * uint3: Three 32 bit unsigned integers
489 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700490 * Vector version of the basic uint type. Provides three uint fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700491 * a single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700492 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700493typedef uint __attribute__((ext_vector_type(3))) uint3;
494
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700495/*
496 * uint4: Four 32 bit unsigned integers
497 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700498 * Vector version of the basic uint type. Provides four uint fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700499 * a single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700500 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700501typedef uint __attribute__((ext_vector_type(4))) uint4;
Jason Sams717e34a2010-03-16 15:35:57 -0700502
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700503/*
504 * ulong2: Two 64 bit unsigned integers
505 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700506 * Vector version of the basic ulong type. Provides two ulong fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700507 * a single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700508 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700509typedef ulong __attribute__((ext_vector_type(2))) ulong2;
510
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700511/*
512 * ulong3: Three 64 bit unsigned integers
513 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700514 * Vector version of the basic ulong type. Provides three ulong fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700515 * into a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700516 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700517typedef ulong __attribute__((ext_vector_type(3))) ulong3;
518
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700519/*
520 * ulong4: Four 64 bit unsigned integers
521 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700522 * Vector version of the basic ulong type. Provides four ulong fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700523 * into a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700524 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700525typedef ulong __attribute__((ext_vector_type(4))) ulong4;
Jason Sams46f2e722011-04-22 17:05:25 -0700526
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700527/*
528 * char2: Two 8 bit signed integers
529 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700530 * Vector version of the basic char type. Provides two char fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700531 * single 16 bit field with 16 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700532 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700533typedef char __attribute__((ext_vector_type(2))) char2;
534
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700535/*
536 * char3: Three 8 bit signed integers
537 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700538 * Vector version of the basic char type. Provides three char fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700539 * a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700540 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700541typedef char __attribute__((ext_vector_type(3))) char3;
542
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700543/*
544 * char4: Four 8 bit signed integers
545 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700546 * Vector version of the basic char type. Provides four char fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700547 * a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700548 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700549typedef char __attribute__((ext_vector_type(4))) char4;
Jason Sams717e34a2010-03-16 15:35:57 -0700550
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700551/*
552 * short2: Two 16 bit signed integers
553 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700554 * Vector version of the basic short type. Provides two short fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700555 * a single 32 bit field with 32 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700556 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700557typedef short __attribute__((ext_vector_type(2))) short2;
558
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700559/*
560 * short3: Three 16 bit signed integers
561 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700562 * Vector version of the basic short type. Provides three short fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700563 * into a single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700564 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700565typedef short __attribute__((ext_vector_type(3))) short3;
566
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700567/*
568 * short4: Four 16 bit signed integers
569 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700570 * Vector version of the basic short type. Provides four short fields packed
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700571 * into a single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700572 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700573typedef short __attribute__((ext_vector_type(4))) short4;
Jason Sams717e34a2010-03-16 15:35:57 -0700574
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700575/*
576 * int2: Two 32 bit signed integers
577 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700578 * Vector version of the basic int type. Provides two int fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700579 * single 64 bit field with 64 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700580 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700581typedef int __attribute__((ext_vector_type(2))) int2;
582
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700583/*
584 * int3: Three 32 bit signed integers
585 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700586 * Vector version of the basic int type. Provides three int fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700587 * single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700588 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700589typedef int __attribute__((ext_vector_type(3))) int3;
590
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700591/*
592 * int4: Four 32 bit signed integers
593 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700594 * Vector version of the basic int type. Provides two four fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700595 * single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700596 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700597typedef int __attribute__((ext_vector_type(4))) int4;
Jason Sams717e34a2010-03-16 15:35:57 -0700598
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700599/*
600 * long2: Two 64 bit signed integers
601 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700602 * Vector version of the basic long type. Provides two long fields packed into a
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700603 * single 128 bit field with 128 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700604 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700605typedef long __attribute__((ext_vector_type(2))) long2;
606
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700607/*
608 * long3: Three 64 bit signed integers
609 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700610 * Vector version of the basic long type. Provides three long fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700611 * a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700612 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700613typedef long __attribute__((ext_vector_type(3))) long3;
614
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700615/*
616 * long4: Four 64 bit signed integers
617 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700618 * Vector version of the basic long type. Provides four long fields packed into
Stephen Hinesd5dccb82011-08-26 19:03:16 -0700619 * a single 256 bit field with 256 bit alignment.
Jason Sams9df3b2b2011-08-08 14:31:25 -0700620 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700621typedef long __attribute__((ext_vector_type(4))) long4;
Jason Sams717e34a2010-03-16 15:35:57 -0700622
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700623/*
624 * rs_matrix4x4: 4x4 matrix of 32 bit floats
Jason Sams9df3b2b2011-08-08 14:31:25 -0700625 *
626 * Native holder for RS matrix. Elements are stored in the array at the
627 * location [row*4 + col]
628 */
Alex Sakhartchouk05f1cb42010-08-11 10:04:21 -0700629typedef struct {
Jason Sams22fa3712010-05-19 17:22:57 -0700630 float m[16];
631} rs_matrix4x4;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700632
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700633/*
634 * rs_matrix3x3: 3x3 matrix of 32 bit floats
Jason Sams9df3b2b2011-08-08 14:31:25 -0700635 *
636 * Native holder for RS matrix. Elements are stored in the array at the
637 * location [row*3 + col]
638 */
Alex Sakhartchouk05f1cb42010-08-11 10:04:21 -0700639typedef struct {
Jason Sams7fe6bce2010-06-24 13:54:11 -0700640 float m[9];
641} rs_matrix3x3;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700642
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700643/*
644 * rs_matrix2x2: 2x2 matrix of 32 bit floats
Jason Sams9df3b2b2011-08-08 14:31:25 -0700645 *
646 * Native holder for RS matrix. Elements are stored in the array at the
647 * location [row*2 + col]
648 */
Alex Sakhartchouk05f1cb42010-08-11 10:04:21 -0700649typedef struct {
Jason Sams7fe6bce2010-06-24 13:54:11 -0700650 float m[4];
651} rs_matrix2x2;
652
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700653/*
654 * rs_quaternion: Quarternion
655 *
656 * Quaternion type for use with the quaternion functions
Jason Sams9df3b2b2011-08-08 14:31:25 -0700657 */
Alex Sakhartchouk0bd010a2010-08-11 14:41:28 -0700658typedef float4 rs_quaternion;
Jason Sams7fe6bce2010-06-24 13:54:11 -0700659
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700660/*
661 * rs_allocation_cubemap_face: Enum for selecting cube map faces
662 *
Jason Sams9df3b2b2011-08-08 14:31:25 -0700663 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700664#if (defined(RS_VERSION) && (RS_VERSION >= 14))
Alex Sakhartchouk74a82792011-06-14 11:13:19 -0700665typedef enum {
666 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
667 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
668 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
669 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
670 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
671 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
672} rs_allocation_cubemap_face;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700673#endif
Alex Sakhartchouk74a82792011-06-14 11:13:19 -0700674
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700675/*
676 * rs_allocation_usage_type: Bitfield to specify the usage types for an allocation
Jason Sams9df3b2b2011-08-08 14:31:25 -0700677 *
678 * These values are ORed together to specify which usages or memory spaces are
679 * relevant to an allocation or an operation on an allocation.
680 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700681#if (defined(RS_VERSION) && (RS_VERSION >= 14))
Alex Sakhartchouk74a82792011-06-14 11:13:19 -0700682typedef enum {
683 RS_ALLOCATION_USAGE_SCRIPT = 0x0001,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700684 RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, // Deprecated.
685 RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, // Deprecated.
686 RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, // Deprecated.
687 RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010 // Deprecated.
Alex Sakhartchouk74a82792011-06-14 11:13:19 -0700688} rs_allocation_usage_type;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700689#endif
Alex Sakhartchouk74a82792011-06-14 11:13:19 -0700690
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700691/*
692 * rs_primitive: How to intepret mesh vertex data
Alex Sakhartchouk8d0f59e2011-12-16 14:15:07 -0800693 *
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700694 * Describes the way mesh vertex data is interpreted when rendering
695 */
696#ifndef __LP64__
697#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk253325d2011-12-15 09:56:10 -0800698typedef enum {
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700699 RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
700 RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
701 RS_PRIMITIVE_LINE_STRIP = 2, // Vertex data will be rendered as a connected line strip
702 RS_PRIMITIVE_TRIANGLE = 3, // Vertices will be rendered as individual triangles
703 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
704 RS_PRIMITIVE_TRIANGLE_FAN = 5, // Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
705 RS_PRIMITIVE_INVALID = 100 // Invalid primitive
Alex Sakhartchouk253325d2011-12-15 09:56:10 -0800706} rs_primitive;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700707#endif
708#endif
Alex Sakhartchouk253325d2011-12-15 09:56:10 -0800709
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700710/*
711 * rs_data_type: Element data types
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800712 *
713 * DataType represents the basic type information for a basic element. The
714 * naming convention follows. For numeric types it is FLOAT,
715 * SIGNED, or UNSIGNED followed by the _BITS where BITS is the
716 * size of the data. BOOLEAN is a true / false (1,0)
717 * represented in an 8 bit container. The UNSIGNED variants
718 * with multiple bit definitions are for packed graphical data
719 * formats and represent vectors with per vector member sizes
720 * which are treated as a single unit for packing and alignment
721 * purposes.
722 *
723 * MATRIX the three matrix types contain FLOAT_32 elements and are treated
724 * as 32 bits for alignment purposes.
725 *
726 * RS_* objects. 32 bit opaque handles.
727 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700728#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800729typedef enum {
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800730 RS_TYPE_NONE = 0,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800731 RS_TYPE_FLOAT_32 = 2,
732 RS_TYPE_FLOAT_64 = 3,
733 RS_TYPE_SIGNED_8 = 4,
734 RS_TYPE_SIGNED_16 = 5,
735 RS_TYPE_SIGNED_32 = 6,
736 RS_TYPE_SIGNED_64 = 7,
737 RS_TYPE_UNSIGNED_8 = 8,
738 RS_TYPE_UNSIGNED_16 = 9,
739 RS_TYPE_UNSIGNED_32 = 10,
740 RS_TYPE_UNSIGNED_64 = 11,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800741 RS_TYPE_BOOLEAN = 12,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800742 RS_TYPE_UNSIGNED_5_6_5 = 13,
743 RS_TYPE_UNSIGNED_5_5_5_1 = 14,
744 RS_TYPE_UNSIGNED_4_4_4_4 = 15,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800745 RS_TYPE_MATRIX_4X4 = 16,
746 RS_TYPE_MATRIX_3X3 = 17,
747 RS_TYPE_MATRIX_2X2 = 18,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800748 RS_TYPE_ELEMENT = 1000,
749 RS_TYPE_TYPE = 1001,
750 RS_TYPE_ALLOCATION = 1002,
751 RS_TYPE_SAMPLER = 1003,
752 RS_TYPE_SCRIPT = 1004,
753 RS_TYPE_MESH = 1005,
754 RS_TYPE_PROGRAM_FRAGMENT = 1006,
755 RS_TYPE_PROGRAM_VERTEX = 1007,
756 RS_TYPE_PROGRAM_RASTER = 1008,
757 RS_TYPE_PROGRAM_STORE = 1009,
Stephen Hinesae8b7952012-04-11 18:09:54 -0700758 RS_TYPE_FONT = 1010,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700759 RS_TYPE_INVALID = 10000
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800760} rs_data_type;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700761#endif
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800762
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700763/*
764 * rs_data_kind: Element data kind
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800765 *
766 * The special interpretation of the data if required. This is primarly
767 * useful for graphical data. USER indicates no special interpretation is
768 * expected. PIXEL is used in conjunction with the standard data types for
769 * representing texture formats.
770 */
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700771#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800772typedef enum {
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800773 RS_KIND_USER = 0,
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800774 RS_KIND_PIXEL_L = 7,
775 RS_KIND_PIXEL_A = 8,
776 RS_KIND_PIXEL_LA = 9,
777 RS_KIND_PIXEL_RGB = 10,
778 RS_KIND_PIXEL_RGBA = 11,
779 RS_KIND_PIXEL_DEPTH = 12,
Jason Samsbc0ca6b2013-02-15 18:13:43 -0800780 RS_KIND_PIXEL_YUV = 13,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700781 RS_KIND_INVALID = 100
Alex Sakhartchoukb0fa3a62011-12-16 09:44:26 -0800782} rs_data_kind;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700783#endif
Alex Sakhartchouk43253872011-09-28 15:23:18 -0700784
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700785/*
786 * rs_depth_func: Depth function
787 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800788 * Specifies conditional drawing depending on the comparison of the incoming
789 * depth to that found in the depth buffer.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700790 */
791#ifndef __LP64__
792#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800793typedef enum {
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700794 RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
795 RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
796 RS_DEPTH_FUNC_LEQUAL = 2, // Drawn if the incoming depth value is less or equal to that in the depth buffer
797 RS_DEPTH_FUNC_GREATER = 3, // Drawn if the incoming depth value is greater than that in the depth buffer
798 RS_DEPTH_FUNC_GEQUAL = 4, // Drawn if the incoming depth value is greater or equal to that in the depth buffer
799 RS_DEPTH_FUNC_EQUAL = 5, // Drawn if the incoming depth value is equal to that in the depth buffer
800 RS_DEPTH_FUNC_NOTEQUAL = 6, // Drawn if the incoming depth value is not equal to that in the depth buffer
801 RS_DEPTH_FUNC_INVALID = 100 // Invalid depth function
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800802} rs_depth_func;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700803#endif
804#endif
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800805
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700806/*
807 * rs_blend_src_func: Blend source function
808 *
809 */
810#ifndef __LP64__
811#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800812typedef enum {
813 RS_BLEND_SRC_ZERO = 0,
814 RS_BLEND_SRC_ONE = 1,
815 RS_BLEND_SRC_DST_COLOR = 2,
816 RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3,
817 RS_BLEND_SRC_SRC_ALPHA = 4,
818 RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5,
819 RS_BLEND_SRC_DST_ALPHA = 6,
820 RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7,
821 RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700822 RS_BLEND_SRC_INVALID = 100
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800823} rs_blend_src_func;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700824#endif
825#endif
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800826
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700827/*
828 * rs_blend_dst_func: Blend destination function
829 *
830 */
831#ifndef __LP64__
832#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800833typedef enum {
834 RS_BLEND_DST_ZERO = 0,
835 RS_BLEND_DST_ONE = 1,
836 RS_BLEND_DST_SRC_COLOR = 2,
837 RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3,
838 RS_BLEND_DST_SRC_ALPHA = 4,
839 RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5,
840 RS_BLEND_DST_DST_ALPHA = 6,
841 RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700842 RS_BLEND_DST_INVALID = 100
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800843} rs_blend_dst_func;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700844#endif
845#endif
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800846
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700847/*
848 * rs_cull_mode: Culling mode
849 *
850 */
851#ifndef __LP64__
852#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800853typedef enum {
854 RS_CULL_BACK = 0,
855 RS_CULL_FRONT = 1,
856 RS_CULL_NONE = 2,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700857 RS_CULL_INVALID = 100
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800858} rs_cull_mode;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700859#endif
860#endif
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800861
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700862/*
863 * rs_sampler_value: Sampler wrap T value
864 *
865 */
866#if (defined(RS_VERSION) && (RS_VERSION >= 16))
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800867typedef enum {
868 RS_SAMPLER_NEAREST = 0,
869 RS_SAMPLER_LINEAR = 1,
870 RS_SAMPLER_LINEAR_MIP_LINEAR = 2,
871 RS_SAMPLER_WRAP = 3,
872 RS_SAMPLER_CLAMP = 4,
873 RS_SAMPLER_LINEAR_MIP_NEAREST = 5,
Tim Murray9e913f42013-02-15 13:29:24 -0800874 RS_SAMPLER_MIRRORED_REPEAT = 6,
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700875 RS_SAMPLER_INVALID = 100
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800876} rs_sampler_value;
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700877#endif
Alex Sakhartchouk09db9072012-02-29 16:43:24 -0800878
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -0700879#endif // RENDERSCRIPT_RS_TYPES_RSH