Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -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: Allocation routines |
| 19 | description: |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame^] | 20 | TODO Adjust documentation. |
| 21 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 22 | Functions that can be used to query the characteristics of an allocation, |
| 23 | to set and get elements of the allocation. |
| 24 | end: |
| 25 | |
| 26 | function: rsAllocationCopy1DRange |
| 27 | version: 14 |
| 28 | ret: void |
| 29 | arg: rs_allocation dstAlloc, "Allocation to copy data into." |
| 30 | arg: uint32_t dstOff, "The offset of the first element to be copied in the destination allocation." |
| 31 | arg: uint32_t dstMip, "Mip level in the destination allocation." |
| 32 | arg: uint32_t count, "The number of elements to be copied." |
| 33 | arg: rs_allocation srcAlloc, "The source data allocation." |
| 34 | arg: uint32_t srcOff, "The offset of the first element in data to be copied in the source allocation." |
| 35 | arg: uint32_t srcMip, "Mip level in the source allocation." |
| 36 | summary: Copy consecutive values between allocations |
| 37 | description: |
| 38 | Copies part of an allocation into another allocation. |
| 39 | |
| 40 | The two allocations must be different. Using this function to copy whithin |
| 41 | the same allocation yields undefined results. |
| 42 | test: none |
| 43 | end: |
| 44 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 45 | function: rsAllocationCopy2DRange |
| 46 | version: 14 |
| 47 | ret: void |
| 48 | arg: rs_allocation dstAlloc, "Allocation to copy data into." |
| 49 | arg: uint32_t dstXoff, "X offset of the region to update in the destination allocation." |
| 50 | arg: uint32_t dstYoff, "Y offset of the region to update in the destination allocation." |
| 51 | arg: uint32_t dstMip, "Mip level in the destination allocation." |
| 52 | arg: rs_allocation_cubemap_face dstFace, "Cubemap face of the destination allocation, ignored for allocations that aren't cubemaps." |
| 53 | arg: uint32_t width, "Width of the incoming region to update." |
| 54 | arg: uint32_t height, "Height of the incoming region to update." |
| 55 | arg: rs_allocation srcAlloc, "The source data allocation." |
| 56 | arg: uint32_t srcXoff, "X offset in data of the source allocation." |
| 57 | arg: uint32_t srcYoff, "Y offset in data of the source allocation." |
| 58 | arg: uint32_t srcMip, "Mip level in the source allocation." |
| 59 | arg: rs_allocation_cubemap_face srcFace, "Cubemap face of the source allocation, ignored for allocations that aren't cubemaps." |
| 60 | summary: Copy a rectangular region between allocations |
| 61 | description: |
| 62 | Copy a rectangular region into the allocation from another allocation. |
| 63 | |
| 64 | The two allocations must be different. Using this function to copy whithin |
| 65 | the same allocation yields undefined results. |
| 66 | test: none |
| 67 | end: |
| 68 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 69 | function: rsAllocationVLoadX_#2#1 |
| 70 | version: 22 |
| 71 | w: 2, 3, 4 |
| 72 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 73 | ret: #2#1 |
| 74 | arg: rs_allocation a |
| 75 | arg: uint32_t x |
| 76 | summary: |
| 77 | description: |
| 78 | Get a single element from an allocation. |
| 79 | test: none |
| 80 | end: |
| 81 | |
| 82 | function: rsAllocationVLoadX_#2#1 |
| 83 | version: 22 |
| 84 | w: 2, 3, 4 |
| 85 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 86 | ret: #2#1 |
| 87 | arg: rs_allocation a |
| 88 | arg: uint32_t x |
| 89 | arg: uint32_t y |
| 90 | test: none |
| 91 | end: |
| 92 | |
| 93 | function: rsAllocationVLoadX_#2#1 |
| 94 | version: 22 |
| 95 | w: 2, 3, 4 |
| 96 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 97 | ret: #2#1 |
| 98 | arg: rs_allocation a |
| 99 | arg: uint32_t x |
| 100 | arg: uint32_t y |
| 101 | arg: uint32_t z |
| 102 | test: none |
| 103 | end: |
| 104 | |
| 105 | function: rsAllocationVStoreX_#2#1 |
| 106 | version: 22 |
| 107 | w: 2, 3, 4 |
| 108 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 109 | ret: void |
| 110 | arg: rs_allocation a |
| 111 | arg: #2#1 val |
| 112 | arg: uint32_t x |
| 113 | summary: |
| 114 | description: |
| 115 | Set a single element of an allocation. |
| 116 | test: none |
| 117 | end: |
| 118 | |
| 119 | function: rsAllocationVStoreX_#2#1 |
| 120 | version: 22 |
| 121 | w: 2, 3, 4 |
| 122 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 123 | ret: void |
| 124 | arg: rs_allocation a |
| 125 | arg: #2#1 val |
| 126 | arg: uint32_t x |
| 127 | arg: uint32_t y |
| 128 | test: none |
| 129 | end: |
| 130 | |
| 131 | function: rsAllocationVStoreX_#2#1 |
| 132 | version: 22 |
| 133 | w: 2, 3, 4 |
| 134 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 135 | ret: void |
| 136 | arg: rs_allocation a |
| 137 | arg: #2#1 val |
| 138 | arg: uint32_t x |
| 139 | arg: uint32_t y |
| 140 | arg: uint32_t z |
| 141 | test: none |
| 142 | end: |
| 143 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 144 | function: rsGetElementAt |
| 145 | ret: const void* |
| 146 | arg: rs_allocation a |
| 147 | arg: uint32_t x |
| 148 | summary: Get an element |
| 149 | description: |
| 150 | Extract a single element from an allocation. |
| 151 | test: none |
| 152 | end: |
| 153 | |
| 154 | function: rsGetElementAt |
| 155 | ret: const void* |
| 156 | arg: rs_allocation a |
| 157 | arg: uint32_t x |
| 158 | arg: uint32_t y |
| 159 | test: none |
| 160 | end: |
| 161 | |
| 162 | function: rsGetElementAt |
| 163 | ret: const void* |
| 164 | arg: rs_allocation a |
| 165 | arg: uint32_t x |
| 166 | arg: uint32_t y |
| 167 | arg: uint32_t z |
| 168 | test: none |
| 169 | end: |
| 170 | |
| 171 | function: rsGetElementAt_#2#1 |
| 172 | version: 9 17 |
| 173 | w: 1, 2, 3, 4 |
| 174 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 175 | ret: #2#1 |
| 176 | arg: rs_allocation a |
| 177 | arg: uint32_t x |
| 178 | inline: |
| 179 | return ((#2#1 *)rsGetElementAt(a, x))[0]; |
| 180 | test: none |
| 181 | end: |
| 182 | |
| 183 | function: rsGetElementAt_#2#1 |
| 184 | version: 9 17 |
| 185 | w: 1, 2, 3, 4 |
| 186 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 187 | ret: #2#1 |
| 188 | arg: rs_allocation a |
| 189 | arg: uint32_t x |
| 190 | arg: uint32_t y |
| 191 | inline: |
| 192 | return ((#2#1 *)rsGetElementAt(a, x, y))[0]; |
| 193 | test: none |
| 194 | end: |
| 195 | |
| 196 | function: rsGetElementAt_#2#1 |
| 197 | version: 9 17 |
| 198 | w: 1, 2, 3, 4 |
| 199 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 200 | ret: #2#1 |
| 201 | arg: rs_allocation a |
| 202 | arg: uint32_t x |
| 203 | arg: uint32_t y |
| 204 | arg: uint32_t z |
| 205 | inline: |
| 206 | return ((#2#1 *)rsGetElementAt(a, x, y, z))[0]; |
| 207 | test: none |
| 208 | end: |
| 209 | |
| 210 | function: rsGetElementAt_#2#1 |
| 211 | version: 18 |
| 212 | w: 1, 2, 3, 4 |
| 213 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 214 | ret: #2#1 |
| 215 | arg: rs_allocation a |
| 216 | arg: uint32_t x |
| 217 | test: none |
| 218 | end: |
| 219 | |
| 220 | function: rsGetElementAt_#2#1 |
| 221 | version: 18 |
| 222 | w: 1, 2, 3, 4 |
| 223 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 224 | ret: #2#1 |
| 225 | arg: rs_allocation a |
| 226 | arg: uint32_t x |
| 227 | arg: uint32_t y |
| 228 | test: none |
| 229 | end: |
| 230 | |
| 231 | function: rsGetElementAt_#2#1 |
| 232 | version: 18 |
| 233 | w: 1, 2, 3, 4 |
| 234 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 235 | ret: #2#1 |
| 236 | arg: rs_allocation a |
| 237 | arg: uint32_t x |
| 238 | arg: uint32_t y |
| 239 | arg: uint32_t z |
| 240 | test: none |
| 241 | end: |
| 242 | |
| 243 | function: rsGetElementAtYuv_uchar_U |
| 244 | version: 18 |
| 245 | ret: uchar |
| 246 | arg: rs_allocation a |
| 247 | arg: uint32_t x |
| 248 | arg: uint32_t y |
| 249 | summary: |
| 250 | description: |
| 251 | Extract a single element from an allocation. |
| 252 | |
| 253 | Coordinates are in the dimensions of the Y plane |
| 254 | test: none |
| 255 | end: |
| 256 | |
| 257 | function: rsGetElementAtYuv_uchar_V |
| 258 | version: 18 |
| 259 | ret: uchar |
| 260 | arg: rs_allocation a |
| 261 | arg: uint32_t x |
| 262 | arg: uint32_t y |
| 263 | summary: |
| 264 | description: |
| 265 | Extract a single element from an allocation. |
| 266 | |
| 267 | Coordinates are in the dimensions of the Y plane |
| 268 | test: none |
| 269 | end: |
| 270 | |
| 271 | function: rsGetElementAtYuv_uchar_Y |
| 272 | version: 18 |
| 273 | ret: uchar |
| 274 | arg: rs_allocation a |
| 275 | arg: uint32_t x |
| 276 | arg: uint32_t y |
| 277 | summary: |
| 278 | description: |
| 279 | Extract a single element from an allocation. |
| 280 | test: none |
| 281 | end: |
| 282 | |
| 283 | function: rsSample |
| 284 | version: 16 |
| 285 | ret: float4 |
| 286 | arg: rs_allocation a, "allocation to sample from" |
| 287 | arg: rs_sampler s, "sampler state" |
| 288 | arg: float location, "location to sample from" |
| 289 | summary: |
| 290 | description: |
| 291 | Fetch allocation in a way described by the sampler |
| 292 | |
| 293 | If your allocation is 1D, use the variant with float for location. |
| 294 | For 2D, use the float2 variant. |
| 295 | test: none |
| 296 | end: |
| 297 | |
| 298 | function: rsSample |
| 299 | version: 16 |
| 300 | ret: float4 |
| 301 | arg: rs_allocation a |
| 302 | arg: rs_sampler s |
| 303 | arg: float location |
| 304 | arg: float lod, "mip level to sample from, for fractional values mip levels will be interpolated if RS_SAMPLER_LINEAR_MIP_LINEAR is used" |
| 305 | test: none |
| 306 | end: |
| 307 | |
| 308 | function: rsSample |
| 309 | version: 16 |
| 310 | ret: float4 |
| 311 | arg: rs_allocation a |
| 312 | arg: rs_sampler s |
| 313 | arg: float2 location |
| 314 | test: none |
| 315 | end: |
| 316 | |
| 317 | function: rsSample |
| 318 | version: 16 |
| 319 | ret: float4 |
| 320 | arg: rs_allocation a |
| 321 | arg: rs_sampler s |
| 322 | arg: float2 location |
| 323 | arg: float lod |
| 324 | test: none |
| 325 | end: |
| 326 | |
| 327 | function: rsSetElementAt |
| 328 | version: 18 |
| 329 | ret: void |
| 330 | arg: rs_allocation a |
| 331 | arg: void* ptr |
| 332 | arg: uint32_t x |
| 333 | summary: Set an element |
| 334 | description: |
| 335 | Set single element of an allocation. |
| 336 | test: none |
| 337 | end: |
| 338 | |
| 339 | function: rsSetElementAt |
| 340 | version: 18 |
| 341 | ret: void |
| 342 | arg: rs_allocation a |
| 343 | arg: void* ptr |
| 344 | arg: uint32_t x |
| 345 | arg: uint32_t y |
| 346 | test: none |
| 347 | end: |
| 348 | |
| 349 | function: rsSetElementAt_#2#1 |
| 350 | version: 18 |
| 351 | w: 1, 2, 3, 4 |
| 352 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 353 | ret: void |
| 354 | arg: rs_allocation a |
| 355 | arg: #2#1 val |
| 356 | arg: uint32_t x |
| 357 | test: none |
| 358 | end: |
| 359 | |
| 360 | function: rsSetElementAt_#2#1 |
| 361 | version: 18 |
| 362 | w: 1, 2, 3, 4 |
| 363 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 364 | ret: void |
| 365 | arg: rs_allocation a |
| 366 | arg: #2#1 val |
| 367 | arg: uint32_t x |
| 368 | arg: uint32_t y |
| 369 | test: none |
| 370 | end: |
| 371 | |
| 372 | function: rsSetElementAt_#2#1 |
| 373 | version: 18 |
| 374 | w: 1, 2, 3, 4 |
| 375 | t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 |
| 376 | ret: void |
| 377 | arg: rs_allocation a |
| 378 | arg: #2#1 val |
| 379 | arg: uint32_t x |
| 380 | arg: uint32_t y |
| 381 | arg: uint32_t z |
| 382 | test: none |
| 383 | end: |