Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 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 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 17 | // Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 18 | |
| 19 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 20 | * rs_for_each.rsh: Kernel Invocation Functions and Types |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 21 | * |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 22 | * The rsForEach() function can be used to invoke the root kernel of a script. |
| 23 | * |
| 24 | * The other functions are used to get the characteristics of the invocation of |
| 25 | * an executing kernel, like dimensions and current indexes. These functions take |
| 26 | * a rs_kernel_context as argument. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 27 | */ |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 28 | |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 29 | #ifndef RENDERSCRIPT_RS_FOR_EACH_RSH |
| 30 | #define RENDERSCRIPT_RS_FOR_EACH_RSH |
| 31 | |
| 32 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 33 | * rs_for_each_strategy_t: Suggested cell processing order |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 34 | * |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 35 | * This type is used to suggest how the invoked kernel should iterate over the cells of the |
| 36 | * allocations. This is a hint only. Implementations may not follow the suggestion. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 37 | * |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 38 | * This specification can help the caching behavior of the running kernel, e.g. the cache |
| 39 | * locality when the processing is distributed over multiple cores. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 40 | */ |
| 41 | typedef enum rs_for_each_strategy { |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 42 | RS_FOR_EACH_STRATEGY_SERIAL = 0, // Prefer contiguous memory regions. |
| 43 | RS_FOR_EACH_STRATEGY_DONT_CARE = 1, // No prefrences. |
| 44 | RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, // Prefer DST. |
| 45 | RS_FOR_EACH_STRATEGY_TILE_SMALL = 3, // Prefer processing small rectangular regions. |
| 46 | RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, // Prefer processing medium rectangular regions. |
| 47 | RS_FOR_EACH_STRATEGY_TILE_LARGE = 5 // Prefer processing large rectangular regions. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 48 | } rs_for_each_strategy_t; |
| 49 | |
| 50 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 51 | * rs_kernel_context: Handle to a kernel invocation context |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 52 | * |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 53 | * The kernel context contains common characteristics of the allocations being iterated |
| 54 | * over, like dimensions, and rarely used indexes, like the Array0 index or the current |
| 55 | * level of detail. |
| 56 | * |
| 57 | * A kernel may be executed in parallel over multiple threads. Each thread will have its |
| 58 | * own context. |
| 59 | * |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 60 | * You can access the context by adding a special parameter named "context" and of type |
| 61 | * rs_kernel_context to your kernel function. See rsGetDimX() and rsGetArray0() for examples. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 62 | */ |
| 63 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 64 | typedef const struct rs_kernel_context_t * rs_kernel_context; |
| 65 | #endif |
| 66 | |
| 67 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 68 | * rs_script_call_t: Cell iteration information |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 69 | * |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 70 | * This structure is used to provide iteration information to a rsForEach call. |
| 71 | * It is currently used to restrict processing to a subset of cells. In future |
| 72 | * versions, it will also be used to provide hint on how to best iterate over |
| 73 | * the cells. |
| 74 | * |
| 75 | * The Start fields are inclusive and the End fields are exclusive. E.g. to iterate |
| 76 | * over cells 4, 5, 6, and 7 in the X dimension, set xStart to 4 and xEnd to 8. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 77 | */ |
| 78 | typedef struct rs_script_call { |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 79 | rs_for_each_strategy_t strategy; // Currently ignored. In the future, will be suggested cell iteration strategy. |
| 80 | uint32_t xStart; // Starting index in the X dimension. |
| 81 | uint32_t xEnd; // Ending index (exclusive) in the X dimension. |
| 82 | uint32_t yStart; // Starting index in the Y dimension. |
| 83 | uint32_t yEnd; // Ending index (exclusive) in the Y dimension. |
| 84 | uint32_t zStart; // Starting index in the Z dimension. |
| 85 | uint32_t zEnd; // Ending index (exclusive) in the Z dimension. |
| 86 | uint32_t arrayStart; // Starting index in the Array0 dimension. |
| 87 | uint32_t arrayEnd; // Ending index (exclusive) in the Array0 dimension. |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 88 | uint32_t array1Start; // Starting index in the Array1 dimension. |
| 89 | uint32_t array1End; // Ending index (exclusive) in the Array1 dimension. |
| 90 | uint32_t array2Start; // Starting index in the Array2 dimension. |
| 91 | uint32_t array2End; // Ending index (exclusive) in the Array2 dimension. |
| 92 | uint32_t array3Start; // Starting index in the Array3 dimension. |
| 93 | uint32_t array3End; // Ending index (exclusive) in the Array3 dimension. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 94 | } rs_script_call_t; |
| 95 | |
| 96 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 97 | * rsForEach: Invoke the root kernel of a script |
| 98 | * |
| 99 | * Invoke the kernel named "root" of the specified script. Like other kernels, this root() |
| 100 | * function will be invoked repeatedly over the cells of the specificed allocation, filling |
| 101 | * the output allocation with the results. |
| 102 | * |
| 103 | * When rsForEach is called, the root script is launched immediately. rsForEach returns |
| 104 | * only when the script has completed and the output allocation is ready to use. |
| 105 | * |
| 106 | * The rs_script argument is typically initialized using a global variable set from Java. |
| 107 | * |
| 108 | * The kernel can be invoked with just an input allocation or just an output allocation. |
| 109 | * This can be done by defining an rs_allocation variable and not initializing it. E.g. |
| 110 | * rs_script gCustomScript; |
| 111 | * void specializedProcessing(rs_allocation in) { |
| 112 | * rs_allocation ignoredOut; |
| 113 | * rsForEach(gCustomScript, in, ignoredOut); |
| 114 | * } |
| 115 | * |
| 116 | * If both input and output allocations are specified, they must have the same dimensions. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 117 | * |
| 118 | * Parameters: |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 119 | * script: Script to call. |
| 120 | * input: Allocation to source data from. |
| 121 | * output: Allocation to write date into. |
| 122 | * usrData: User defined data to pass to the script. May be NULL. |
| 123 | * sc: Extra control information used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL. |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 124 | * usrDataLen: Size of the userData structure. This will be used to perform a shallow copy of the data if necessary. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 125 | */ |
| 126 | #if !defined(RS_VERSION) || (RS_VERSION <= 13) |
| 127 | extern void __attribute__((overloadable)) |
| 128 | rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, |
| 129 | const rs_script_call_t* sc); |
| 130 | #endif |
| 131 | |
| 132 | #if !defined(RS_VERSION) || (RS_VERSION <= 13) |
| 133 | extern void __attribute__((overloadable)) |
| 134 | rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData); |
| 135 | #endif |
| 136 | |
| 137 | #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20)) |
| 138 | extern void __attribute__((overloadable)) |
| 139 | rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, |
| 140 | size_t usrDataLen, const rs_script_call_t* sc); |
| 141 | #endif |
| 142 | |
| 143 | #if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20)) |
| 144 | extern void __attribute__((overloadable)) |
| 145 | rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, |
| 146 | size_t usrDataLen); |
| 147 | #endif |
| 148 | |
| 149 | #if (defined(RS_VERSION) && (RS_VERSION >= 14)) |
| 150 | extern void __attribute__((overloadable)) |
| 151 | rsForEach(rs_script script, rs_allocation input, rs_allocation output); |
| 152 | #endif |
| 153 | |
| 154 | /* |
| 155 | * rsGetArray0: Index in the Array0 dimension for the specified context |
| 156 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 157 | * Returns the index in the Array0 dimension of the cell being processed, as specified |
| 158 | * by the supplied context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 159 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 160 | * This context is created when a kernel is launched and updated at each iteration. |
| 161 | * It contains common characteristics of the allocations being iterated over and rarely |
| 162 | * used indexes, like the Array0 index. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 163 | * |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 164 | * You can access the context by adding a special parameter named "context" and of |
| 165 | * type rs_kernel_context to your kernel function. E.g. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 166 | * short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) { |
| 167 | * // The current index in the common x, y, z, w dimensions are accessed by |
| 168 | * // adding these variables as arguments. For the more rarely used indexes |
| 169 | * // to the other dimensions, extract them from the context: |
| 170 | * uint32_t index_a0 = rsGetArray0(context); |
| 171 | * //... |
| 172 | * } |
| 173 | * |
| 174 | * This function returns 0 if the Array0 dimension is not present. |
| 175 | */ |
| 176 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 177 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 178 | rsGetArray0(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 179 | #endif |
| 180 | |
| 181 | /* |
| 182 | * rsGetArray1: Index in the Array1 dimension for the specified context |
| 183 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 184 | * Returns the index in the Array1 dimension of the cell being processed, as specified |
| 185 | * by the supplied context. See rsGetArray0() for an explanation of the context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 186 | * |
| 187 | * Returns 0 if the Array1 dimension is not present. |
| 188 | */ |
| 189 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 190 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 191 | rsGetArray1(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 192 | #endif |
| 193 | |
| 194 | /* |
| 195 | * rsGetArray2: Index in the Array2 dimension for the specified context |
| 196 | * |
| 197 | * Returns the index in the Array2 dimension of the cell being processed, |
| 198 | * as specified by the supplied context. See rsGetArray0() for an explanation |
| 199 | * of the context. |
| 200 | * |
| 201 | * Returns 0 if the Array2 dimension is not present. |
| 202 | */ |
| 203 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 204 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 205 | rsGetArray2(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 206 | #endif |
| 207 | |
| 208 | /* |
| 209 | * rsGetArray3: Index in the Array3 dimension for the specified context |
| 210 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 211 | * Returns the index in the Array3 dimension of the cell being processed, as specified |
| 212 | * by the supplied context. See rsGetArray0() for an explanation of the context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 213 | * |
| 214 | * Returns 0 if the Array3 dimension is not present. |
| 215 | */ |
| 216 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 217 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 218 | rsGetArray3(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 219 | #endif |
| 220 | |
| 221 | /* |
| 222 | * rsGetDimArray0: Size of the Array0 dimension for the specified context |
| 223 | * |
| 224 | * Returns the size of the Array0 dimension for the specified context. |
| 225 | * See rsGetDimX() for an explanation of the context. |
| 226 | * |
| 227 | * Returns 0 if the Array0 dimension is not present. |
| 228 | */ |
| 229 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 230 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 231 | rsGetDimArray0(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 232 | #endif |
| 233 | |
| 234 | /* |
| 235 | * rsGetDimArray1: Size of the Array1 dimension for the specified context |
| 236 | * |
| 237 | * Returns the size of the Array1 dimension for the specified context. |
| 238 | * See rsGetDimX() for an explanation of the context. |
| 239 | * |
| 240 | * Returns 0 if the Array1 dimension is not present. |
| 241 | */ |
| 242 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 243 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 244 | rsGetDimArray1(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 245 | #endif |
| 246 | |
| 247 | /* |
| 248 | * rsGetDimArray2: Size of the Array2 dimension for the specified context |
| 249 | * |
| 250 | * Returns the size of the Array2 dimension for the specified context. |
| 251 | * See rsGetDimX() for an explanation of the context. |
| 252 | * |
| 253 | * Returns 0 if the Array2 dimension is not present. |
| 254 | */ |
| 255 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 256 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 257 | rsGetDimArray2(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 258 | #endif |
| 259 | |
| 260 | /* |
| 261 | * rsGetDimArray3: Size of the Array3 dimension for the specified context |
| 262 | * |
| 263 | * Returns the size of the Array3 dimension for the specified context. |
| 264 | * See rsGetDimX() for an explanation of the context. |
| 265 | * |
| 266 | * Returns 0 if the Array3 dimension is not present. |
| 267 | */ |
| 268 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 269 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 270 | rsGetDimArray3(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 271 | #endif |
| 272 | |
| 273 | /* |
| 274 | * rsGetDimHasFaces: Presence of more than one face for the specified context |
| 275 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 276 | * If the context refers to a cubemap, this function returns true if there's more than |
| 277 | * one face present. In all other cases, it returns false. See rsGetDimX() for an |
| 278 | * explanation of the context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 279 | * |
| 280 | * rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool. |
| 281 | * |
| 282 | * Returns: Returns true if more than one face is present, false otherwise. |
| 283 | */ |
| 284 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 285 | extern bool __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 286 | rsGetDimHasFaces(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 287 | #endif |
| 288 | |
| 289 | /* |
| 290 | * rsGetDimLod: Number of levels of detail for the specified context |
| 291 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 292 | * Returns the number of levels of detail for the specified context. This is useful |
| 293 | * for mipmaps. See rsGetDimX() for an explanation of the context. |
| 294 | * |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 295 | * Returns 0 if Level of Detail is not used. |
| 296 | * |
| 297 | * rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual |
| 298 | * number of levels. |
| 299 | */ |
| 300 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 301 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 302 | rsGetDimLod(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 303 | #endif |
| 304 | |
| 305 | /* |
| 306 | * rsGetDimX: Size of the X dimension for the specified context |
| 307 | * |
| 308 | * Returns the size of the X dimension for the specified context. |
| 309 | * |
| 310 | * This context is created when a kernel is launched. It contains common |
| 311 | * characteristics of the allocations being iterated over by the kernel in |
| 312 | * a very efficient structure. It also contains rarely used indexes. |
| 313 | * |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 314 | * You can access it by adding a special parameter named "context" and of |
| 315 | * type rs_kernel_context to your kernel function. E.g. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 316 | * int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) { |
| 317 | * uint32_t size = rsGetDimX(context); //... |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 318 | * |
| 319 | * To get the dimension of specific allocation, use rsAllocationGetDimX(). |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 320 | */ |
| 321 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 322 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 323 | rsGetDimX(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 324 | #endif |
| 325 | |
| 326 | /* |
| 327 | * rsGetDimY: Size of the Y dimension for the specified context |
| 328 | * |
| 329 | * Returns the size of the X dimension for the specified context. |
| 330 | * See rsGetDimX() for an explanation of the context. |
| 331 | * |
| 332 | * Returns 0 if the Y dimension is not present. |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 333 | * |
| 334 | * To get the dimension of specific allocation, use rsAllocationGetDimY(). |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 335 | */ |
| 336 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 337 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 338 | rsGetDimY(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 339 | #endif |
| 340 | |
| 341 | /* |
| 342 | * rsGetDimZ: Size of the Z dimension for the specified context |
| 343 | * |
| 344 | * Returns the size of the Z dimension for the specified context. |
| 345 | * See rsGetDimX() for an explanation of the context. |
| 346 | * |
| 347 | * Returns 0 if the Z dimension is not present. |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 348 | * |
| 349 | * To get the dimension of specific allocation, use rsAllocationGetDimZ(). |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 350 | */ |
| 351 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 352 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 353 | rsGetDimZ(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 354 | #endif |
| 355 | |
| 356 | /* |
| 357 | * rsGetFace: Coordinate of the Face for the specified context |
| 358 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 359 | * Returns the face on which the cell being processed is found, as specified by the |
| 360 | * supplied context. See rsGetArray0() for an explanation of the context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 361 | * |
| 362 | * Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not |
| 363 | * present. |
| 364 | */ |
| 365 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 366 | extern rs_allocation_cubemap_face __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 367 | rsGetFace(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 368 | #endif |
| 369 | |
| 370 | /* |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 371 | * rsGetLod: Index in the Levels of Detail dimension for the specified context |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 372 | * |
Pirama Arumuga Nainar | db74586 | 2015-05-11 14:34:37 -0700 | [diff] [blame] | 373 | * Returns the index in the Levels of Detail dimension of the cell being processed, |
| 374 | * as specified by the supplied context. See rsGetArray0() for an explanation of |
| 375 | * the context. |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 376 | * |
| 377 | * Returns 0 if the Levels of Detail dimension is not present. |
| 378 | */ |
| 379 | #if (defined(RS_VERSION) && (RS_VERSION >= 23)) |
| 380 | extern uint32_t __attribute__((overloadable)) |
Miao Wang | cd72e38 | 2015-08-20 15:52:21 -0700 | [diff] [blame] | 381 | rsGetLod(rs_kernel_context context); |
Jean-Luc Brouillet | 4fbd903 | 2015-04-02 14:46:27 -0700 | [diff] [blame] | 382 | #endif |
| 383 | |
| 384 | #endif // RENDERSCRIPT_RS_FOR_EACH_RSH |