Jean-Luc Brouillet | be21638 | 2015-03-22 12:44: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 | |
| 17 | header: |
| 18 | summary: TODO Add documentation |
| 19 | description: |
| 20 | TODO Add documentation |
| 21 | end: |
| 22 | |
| 23 | type: rs_for_each_strategy_t |
| 24 | enum: rs_for_each_strategy |
| 25 | value: RS_FOR_EACH_STRATEGY_SERIAL = 0 |
| 26 | value: RS_FOR_EACH_STRATEGY_DONT_CARE = 1 |
| 27 | value: RS_FOR_EACH_STRATEGY_DST_LINEAR = 2 |
| 28 | value: RS_FOR_EACH_STRATEGY_TILE_SMALL = 3 |
| 29 | value: RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4 |
| 30 | value: RS_FOR_EACH_STRATEGY_TILE_LARGE = 5 |
| 31 | summary: Launch order hint for rsForEach calls |
| 32 | description: |
| 33 | Launch order hint for rsForEach calls. This provides a hint to the system to |
| 34 | determine in which order the root function of the target is called with each |
| 35 | cell of the allocation. |
| 36 | |
| 37 | This is a hint and implementations may not obey the order. |
| 38 | end: |
| 39 | |
| 40 | type: rs_kernel_context |
| 41 | version: 23 |
| 42 | simple: const struct rs_kernel_context_t * |
| 43 | summary: Opaque handle to RenderScript kernel invocation context |
| 44 | description: |
| 45 | TODO |
| 46 | end: |
| 47 | |
| 48 | type: rs_script_call_t |
| 49 | struct: rs_script_call |
| 50 | field: rs_for_each_strategy_t strategy |
| 51 | field: uint32_t xStart |
| 52 | field: uint32_t xEnd |
| 53 | field: uint32_t yStart |
| 54 | field: uint32_t yEnd |
| 55 | field: uint32_t zStart |
| 56 | field: uint32_t zEnd |
| 57 | field: uint32_t arrayStart |
| 58 | field: uint32_t arrayEnd |
| 59 | summary: Provides extra information to a rsForEach call |
| 60 | description: |
| 61 | Structure to provide extra information to a rsForEach call. Primarly used to |
| 62 | restrict the call to a subset of cells in the allocation. |
| 63 | end: |
| 64 | |
| 65 | function: rsForEach |
| 66 | version: 9 13 |
| 67 | ret: void |
| 68 | arg: rs_script script, "The target script to call" |
| 69 | arg: rs_allocation input, "The allocation to source data from" |
| 70 | arg: rs_allocation output, "the allocation to write date into" |
| 71 | arg: const void* usrData, "The user defined params to pass to the root script. May be NULL." |
| 72 | arg: const rs_script_call_t* sc, "Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL." |
| 73 | summary: |
| 74 | description: |
| 75 | Make a script to script call to launch work. One of the input or output is |
| 76 | required to be a valid object. The input and output must be of the same |
| 77 | dimensions. |
| 78 | test: none |
| 79 | end: |
| 80 | |
| 81 | function: rsForEach |
| 82 | version: 9 13 |
| 83 | ret: void |
| 84 | arg: rs_script script |
| 85 | arg: rs_allocation input |
| 86 | arg: rs_allocation output |
| 87 | arg: const void* usrData |
| 88 | test: none |
| 89 | end: |
| 90 | |
| 91 | function: rsForEach |
| 92 | version: 14 20 |
| 93 | ret: void |
| 94 | arg: rs_script script |
| 95 | arg: rs_allocation input |
| 96 | arg: rs_allocation output |
| 97 | arg: const void* usrData |
| 98 | arg: size_t usrDataLen, "The size of the userData structure. This will be used to perform a shallow copy of the data if necessary." |
| 99 | arg: const rs_script_call_t* sc |
| 100 | test: none |
| 101 | end: |
| 102 | |
| 103 | function: rsForEach |
| 104 | version: 14 20 |
| 105 | ret: void |
| 106 | arg: rs_script script |
| 107 | arg: rs_allocation input |
| 108 | arg: rs_allocation output |
| 109 | arg: const void* usrData |
| 110 | arg: size_t usrDataLen |
| 111 | test: none |
| 112 | end: |
| 113 | |
| 114 | function: rsForEach |
| 115 | version: 14 |
| 116 | ret: void |
| 117 | arg: rs_script script |
| 118 | arg: rs_allocation input |
| 119 | arg: rs_allocation output |
| 120 | test: none |
| 121 | end: |
| 122 | |
| 123 | function: rsGetArray0 |
| 124 | version: 23 |
| 125 | ret: uint32_t |
| 126 | arg: rs_kernel_context ctxt |
| 127 | summary: Index in the Array0 dimension for the specified context |
| 128 | description: |
| 129 | Returns the index in the Array0 dimension of the cell being processed, |
| 130 | as specified by the supplied context. |
| 131 | |
| 132 | This context is created when a kernel is launched and updated at each |
| 133 | iteration. It contains common characteristics of the allocations being |
| 134 | iterated over and rarely used indexes, like the Array0 index. |
| 135 | |
| 136 | You can access the context by adding a rs_kernel_context argument to your |
| 137 | kernel function. E.g.<br/> |
| 138 | <code>short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {<br/> |
| 139 | // The current index in the common x, y, z, w dimensions are accessed by<br/> |
| 140 | // adding these variables as arguments. For the more rarely used indexes<br/> |
| 141 | // to the other dimensions, extract them from the context:<br/> |
| 142 | uint32_t index_a0 = rsGetArray0(context);<br/> |
| 143 | //...<br/> |
| 144 | }<br/></code> |
| 145 | |
| 146 | This function returns 0 if the Array0 dimension is not present. |
| 147 | test: none |
| 148 | end: |
| 149 | |
| 150 | function: rsGetArray1 |
| 151 | version: 23 |
| 152 | ret: uint32_t |
| 153 | arg: rs_kernel_context ctxt |
| 154 | summary: Index in the Array1 dimension for the specified context |
| 155 | description: |
| 156 | Returns the index in the Array1 dimension of the cell being processed, |
| 157 | as specified by the supplied context. See @rsGetArray0() for an explanation |
| 158 | of the context. |
| 159 | |
| 160 | Returns 0 if the Array1 dimension is not present. |
| 161 | test: none |
| 162 | end: |
| 163 | |
| 164 | function: rsGetArray2 |
| 165 | version: 23 |
| 166 | ret: uint32_t |
| 167 | arg: rs_kernel_context ctxt |
| 168 | summary: Index in the Array2 dimension for the specified context |
| 169 | description: |
| 170 | Returns the index in the Array2 dimension of the cell being processed, |
| 171 | as specified by the supplied context. See @rsGetArray0() for an explanation |
| 172 | of the context. |
| 173 | |
| 174 | Returns 0 if the Array2 dimension is not present. |
| 175 | test: none |
| 176 | end: |
| 177 | |
| 178 | function: rsGetArray3 |
| 179 | version: 23 |
| 180 | ret: uint32_t |
| 181 | arg: rs_kernel_context ctxt |
| 182 | summary: Index in the Array3 dimension for the specified context |
| 183 | description: |
| 184 | Returns the index in the Array3 dimension of the cell being processed, |
| 185 | as specified by the supplied context. See @rsGetArray0() for an explanation |
| 186 | of the context. |
| 187 | |
| 188 | Returns 0 if the Array3 dimension is not present. |
| 189 | test: none |
| 190 | end: |
| 191 | |
| 192 | function: rsGetDimArray0 |
| 193 | version: 23 |
| 194 | ret: uint32_t |
| 195 | arg: rs_kernel_context ctxt |
| 196 | summary: Size of the Array0 dimension for the specified context |
| 197 | description: |
| 198 | Returns the size of the Array0 dimension for the specified context. |
| 199 | See @rsGetDimX() for an explanation of the context. |
| 200 | |
| 201 | Returns 0 if the Array0 dimension is not present. |
| 202 | #TODO Add an hyperlink to something that explains Array0/1/2/3 |
| 203 | # for the relevant functions. |
| 204 | test: none |
| 205 | end: |
| 206 | |
| 207 | function: rsGetDimArray1 |
| 208 | version: 23 |
| 209 | ret: uint32_t |
| 210 | arg: rs_kernel_context ctxt |
| 211 | summary: Size of the Array1 dimension for the specified context |
| 212 | description: |
| 213 | Returns the size of the Array1 dimension for the specified context. |
| 214 | See @rsGetDimX() for an explanation of the context. |
| 215 | |
| 216 | Returns 0 if the Array1 dimension is not present. |
| 217 | test: none |
| 218 | end: |
| 219 | |
| 220 | function: rsGetDimArray2 |
| 221 | version: 23 |
| 222 | ret: uint32_t |
| 223 | arg: rs_kernel_context ctxt |
| 224 | summary: Size of the Array2 dimension for the specified context |
| 225 | description: |
| 226 | Returns the size of the Array2 dimension for the specified context. |
| 227 | See @rsGetDimX() for an explanation of the context. |
| 228 | |
| 229 | Returns 0 if the Array2 dimension is not present. |
| 230 | test: none |
| 231 | end: |
| 232 | |
| 233 | function: rsGetDimArray3 |
| 234 | version: 23 |
| 235 | ret: uint32_t |
| 236 | arg: rs_kernel_context ctxt |
| 237 | summary: Size of the Array3 dimension for the specified context |
| 238 | description: |
| 239 | Returns the size of the Array3 dimension for the specified context. |
| 240 | See @rsGetDimX() for an explanation of the context. |
| 241 | |
| 242 | Returns 0 if the Array3 dimension is not present. |
| 243 | test: none |
| 244 | end: |
| 245 | |
| 246 | function: rsGetDimHasFaces |
| 247 | version: 23 |
| 248 | ret: bool, "Returns true if more than one face is present, false otherwise." |
| 249 | arg: rs_kernel_context ctxt |
| 250 | summary: Presence of more than one face for the specified context |
| 251 | description: |
| 252 | If the context refers to a cubemap, this function returns true if there's |
| 253 | more than one face present. In all other cases, it returns false. |
| 254 | See @rsGetDimX() for an explanation of the context. |
| 255 | |
| 256 | @rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool. |
| 257 | test: none |
| 258 | end: |
| 259 | |
| 260 | function: rsGetDimLod |
| 261 | version: 23 |
| 262 | ret: uint32_t |
| 263 | arg: rs_kernel_context ctxt |
| 264 | summary: Number of levels of detail for the specified context |
| 265 | description: |
| 266 | Returns the number of levels of detail for the specified context. |
| 267 | This is useful for mipmaps. See @rsGetDimX() for an explanation of the context. |
| 268 | Returns 0 if Level of Detail is not used. |
| 269 | |
| 270 | @rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual |
| 271 | number of levels. |
| 272 | test: none |
| 273 | end: |
| 274 | |
| 275 | function: rsGetDimX |
| 276 | version: 23 |
| 277 | ret: uint32_t |
| 278 | arg: rs_kernel_context ctxt |
| 279 | summary: Size of the X dimension for the specified context |
| 280 | description: |
| 281 | Returns the size of the X dimension for the specified context. |
| 282 | |
| 283 | This context is created when a kernel is launched. It contains common |
| 284 | characteristics of the allocations being iterated over by the kernel in |
| 285 | a very efficient structure. It also contains rarely used indexes. |
| 286 | |
| 287 | You can access it by adding a rs_kernel_context argument to your kernel |
| 288 | function. E.g.<br/> |
| 289 | <code>int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {<br/> |
| 290 | uint32_t size = rsGetDimX(context); //...<br/></code> |
| 291 | test: none |
| 292 | end: |
| 293 | |
| 294 | function: rsGetDimY |
| 295 | version: 23 |
| 296 | ret: uint32_t |
| 297 | arg: rs_kernel_context ctxt |
| 298 | summary: Size of the Y dimension for the specified context |
| 299 | description: |
| 300 | Returns the size of the X dimension for the specified context. |
| 301 | See @rsGetDimX() for an explanation of the context. |
| 302 | |
| 303 | Returns 0 if the Y dimension is not present. |
| 304 | test: none |
| 305 | end: |
| 306 | |
| 307 | function: rsGetDimZ |
| 308 | version: 23 |
| 309 | ret: uint32_t |
| 310 | arg: rs_kernel_context ctxt |
| 311 | summary: Size of the Z dimension for the specified context |
| 312 | description: |
| 313 | Returns the size of the Z dimension for the specified context. |
| 314 | See @rsGetDimX() for an explanation of the context. |
| 315 | |
| 316 | Returns 0 if the Z dimension is not present. |
| 317 | test: none |
| 318 | end: |
| 319 | |
| 320 | function: rsGetFace |
| 321 | version: 23 |
| 322 | ret: rs_allocation_cubemap_face |
| 323 | arg: rs_kernel_context ctxt |
| 324 | summary: Coordinate of the Face for the specified context |
| 325 | description: |
| 326 | Returns the face on which the cell being processed is found, as specified |
| 327 | by the supplied context. See @rsGetArray0() for an explanation of the context. |
| 328 | |
| 329 | Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not |
| 330 | present. |
| 331 | test: none |
| 332 | end: |
| 333 | |
| 334 | function: rsGetLod |
| 335 | version: 23 |
| 336 | ret: uint32_t |
| 337 | arg: rs_kernel_context ctxt |
| 338 | summary: Index in the Levels of Detail dimension for the specified context. |
| 339 | description: |
| 340 | Returns the index in the Levels of Detail dimension of the cell being |
| 341 | processed, as specified by the supplied context. See @rsGetArray0() for |
| 342 | an explanation of the context. |
| 343 | |
| 344 | Returns 0 if the Levels of Detail dimension is not present. |
| 345 | test: none |
| 346 | end: |