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: RenderScript graphics API |
| 19 | description: |
| 20 | A set of graphics functions used by RenderScript. |
| 21 | include: |
| 22 | #ifdef __LP64__ |
| 23 | // TODO We need to fix some of the builds before enabling this error: |
| 24 | // #error "RenderScript graphics is deprecated and not supported in 64bit mode." |
Jason Sams | 41371c7 | 2015-03-26 20:46:57 +0000 | [diff] [blame^] | 25 | #else |
| 26 | #include "rs_mesh.rsh" |
| 27 | #include "rs_program.rsh" |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 28 | #endif |
| 29 | end: |
| 30 | |
| 31 | function: rsgAllocationSyncAll |
| 32 | size: 32 |
| 33 | ret: void |
| 34 | arg: rs_allocation alloc |
| 35 | summary: |
| 36 | description: |
| 37 | Sync the contents of an allocation. |
| 38 | |
| 39 | If the source is specified, sync from memory space specified by source. |
| 40 | |
| 41 | If the source is not specified, sync from its SCRIPT memory space to its HW |
| 42 | memory spaces. |
| 43 | test: none |
| 44 | end: |
| 45 | |
| 46 | function: rsgAllocationSyncAll |
| 47 | version: 14 |
| 48 | size: 32 |
| 49 | ret: void |
| 50 | arg: rs_allocation alloc |
| 51 | arg: rs_allocation_usage_type source |
| 52 | test: none |
| 53 | end: |
| 54 | |
| 55 | function: rsgBindColorTarget |
| 56 | version: 14 |
| 57 | size: 32 |
| 58 | ret: void |
| 59 | arg: rs_allocation colorTarget |
| 60 | arg: uint slot |
| 61 | summary: |
| 62 | description: |
| 63 | Set the color target used for all subsequent rendering calls |
| 64 | test: none |
| 65 | end: |
| 66 | |
| 67 | function: rsgBindConstant |
| 68 | size: 32 |
| 69 | ret: void |
| 70 | arg: rs_program_fragment ps, "program fragment object" |
| 71 | arg: uint slot, "index of the constant buffer on the program" |
| 72 | arg: rs_allocation c, "constants to bind" |
| 73 | summary: |
| 74 | description: |
| 75 | Bind a new Allocation object to a ProgramFragment or ProgramVertex. |
| 76 | The Allocation must be a valid constant input for the Program. |
| 77 | test: none |
| 78 | end: |
| 79 | |
| 80 | function: rsgBindConstant |
| 81 | size: 32 |
| 82 | ret: void |
| 83 | arg: rs_program_vertex pv, "program vertex object" |
| 84 | arg: uint slot |
| 85 | arg: rs_allocation c |
| 86 | test: none |
| 87 | end: |
| 88 | |
| 89 | function: rsgBindDepthTarget |
| 90 | version: 14 |
| 91 | size: 32 |
| 92 | ret: void |
| 93 | arg: rs_allocation depthTarget |
| 94 | summary: |
| 95 | description: |
| 96 | Set the depth target used for all subsequent rendering calls |
| 97 | test: none |
| 98 | end: |
| 99 | |
| 100 | function: rsgBindFont |
| 101 | size: 32 |
| 102 | ret: void |
| 103 | arg: rs_font font, "object to bind" |
| 104 | summary: |
| 105 | description: |
| 106 | Binds the font object to be used for all subsequent font rendering calls |
| 107 | test: none |
| 108 | end: |
| 109 | |
| 110 | function: rsgBindProgramFragment |
| 111 | size: 32 |
| 112 | ret: void |
| 113 | arg: rs_program_fragment pf |
| 114 | summary: |
| 115 | description: |
| 116 | Bind a new ProgramFragment to the rendering context. |
| 117 | test: none |
| 118 | end: |
| 119 | |
| 120 | function: rsgBindProgramRaster |
| 121 | size: 32 |
| 122 | ret: void |
| 123 | arg: rs_program_raster pr |
| 124 | summary: |
| 125 | description: |
| 126 | Bind a new ProgramRaster to the rendering context. |
| 127 | test: none |
| 128 | end: |
| 129 | |
| 130 | function: rsgBindProgramStore |
| 131 | size: 32 |
| 132 | ret: void |
| 133 | arg: rs_program_store ps |
| 134 | summary: |
| 135 | description: |
| 136 | Bind a new ProgramStore to the rendering context. |
| 137 | test: none |
| 138 | end: |
| 139 | |
| 140 | function: rsgBindProgramVertex |
| 141 | size: 32 |
| 142 | ret: void |
| 143 | arg: rs_program_vertex pv |
| 144 | summary: |
| 145 | description: |
| 146 | Bind a new ProgramVertex to the rendering context. |
| 147 | test: none |
| 148 | end: |
| 149 | |
| 150 | function: rsgBindSampler |
| 151 | size: 32 |
| 152 | ret: void |
| 153 | arg: rs_program_fragment fragment |
| 154 | arg: uint slot |
| 155 | arg: rs_sampler sampler |
| 156 | summary: |
| 157 | description: |
| 158 | Bind a new Sampler object to a ProgramFragment. The sampler will |
| 159 | operate on the texture bound at the matching slot. |
| 160 | test: none |
| 161 | end: |
| 162 | |
| 163 | function: rsgBindTexture |
| 164 | size: 32 |
| 165 | ret: void |
| 166 | arg: rs_program_fragment v |
| 167 | arg: uint slot |
| 168 | arg: rs_allocation alloc |
| 169 | summary: |
| 170 | description: |
| 171 | Bind a new Allocation object to a ProgramFragment. The |
| 172 | Allocation must be a valid texture for the Program. The sampling |
| 173 | of the texture will be controled by the Sampler bound at the |
| 174 | matching slot. |
| 175 | test: none |
| 176 | end: |
| 177 | |
| 178 | function: rsgClearAllRenderTargets |
| 179 | version: 14 |
| 180 | size: 32 |
| 181 | ret: void |
| 182 | summary: |
| 183 | description: |
| 184 | Clear all color and depth targets and resume rendering into |
| 185 | the framebuffer |
| 186 | test: none |
| 187 | end: |
| 188 | |
| 189 | function: rsgClearColor |
| 190 | size: 32 |
| 191 | ret: void |
| 192 | arg: float r |
| 193 | arg: float g |
| 194 | arg: float b |
| 195 | arg: float a |
| 196 | summary: |
| 197 | description: |
| 198 | Clears the rendering surface to the specified color. |
| 199 | test: none |
| 200 | end: |
| 201 | |
| 202 | function: rsgClearColorTarget |
| 203 | version: 14 |
| 204 | size: 32 |
| 205 | ret: void |
| 206 | arg: uint slot |
| 207 | summary: |
| 208 | description: |
| 209 | Clear the previously set color target |
| 210 | test: none |
| 211 | end: |
| 212 | |
| 213 | function: rsgClearDepth |
| 214 | size: 32 |
| 215 | ret: void |
| 216 | arg: float value |
| 217 | summary: |
| 218 | description: |
| 219 | Clears the depth suface to the specified value. |
| 220 | test: none |
| 221 | end: |
| 222 | |
| 223 | function: rsgClearDepthTarget |
| 224 | version: 14 |
| 225 | size: 32 |
| 226 | ret: void |
| 227 | summary: |
| 228 | description: |
| 229 | Clear the previously set depth target |
| 230 | test: none |
| 231 | end: |
| 232 | |
| 233 | function: rsgDrawMesh |
| 234 | size: 32 |
| 235 | ret: void |
| 236 | arg: rs_mesh ism, "mesh object to render" |
| 237 | summary: |
| 238 | description: |
| 239 | Draw a mesh using the current context state. |
| 240 | |
| 241 | If primitiveIndex is specified, draw part of a mesh using the current context state. |
| 242 | |
| 243 | If start and len are also specified, draw specified index range of part of a mesh using the current context state. |
| 244 | |
| 245 | Otherwise the whole mesh is rendered. |
| 246 | test: none |
| 247 | end: |
| 248 | |
| 249 | function: rsgDrawMesh |
| 250 | size: 32 |
| 251 | ret: void |
| 252 | arg: rs_mesh ism |
| 253 | arg: uint primitiveIndex, "for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw." |
| 254 | test: none |
| 255 | end: |
| 256 | |
| 257 | function: rsgDrawMesh |
| 258 | size: 32 |
| 259 | ret: void |
| 260 | arg: rs_mesh ism |
| 261 | arg: uint primitiveIndex |
| 262 | arg: uint start, "starting index in the range" |
| 263 | arg: uint len, "number of indices to draw" |
| 264 | test: none |
| 265 | end: |
| 266 | |
| 267 | function: rsgDrawQuad |
| 268 | size: 32 |
| 269 | ret: void |
| 270 | arg: float x1 |
| 271 | arg: float y1 |
| 272 | arg: float z1 |
| 273 | arg: float x2 |
| 274 | arg: float y2 |
| 275 | arg: float z2 |
| 276 | arg: float x3 |
| 277 | arg: float y3 |
| 278 | arg: float z3 |
| 279 | arg: float x4 |
| 280 | arg: float y4 |
| 281 | arg: float z4 |
| 282 | summary: |
| 283 | description: |
| 284 | Low performance utility function for drawing a simple quad. Not intended for |
| 285 | drawing large quantities of geometry. |
| 286 | test: none |
| 287 | end: |
| 288 | |
| 289 | function: rsgDrawQuadTexCoords |
| 290 | size: 32 |
| 291 | ret: void |
| 292 | arg: float x1 |
| 293 | arg: float y1 |
| 294 | arg: float z1 |
| 295 | arg: float u1 |
| 296 | arg: float v1 |
| 297 | arg: float x2 |
| 298 | arg: float y2 |
| 299 | arg: float z2 |
| 300 | arg: float u2 |
| 301 | arg: float v2 |
| 302 | arg: float x3 |
| 303 | arg: float y3 |
| 304 | arg: float z3 |
| 305 | arg: float u3 |
| 306 | arg: float v3 |
| 307 | arg: float x4 |
| 308 | arg: float y4 |
| 309 | arg: float z4 |
| 310 | arg: float u4 |
| 311 | arg: float v4 |
| 312 | summary: |
| 313 | description: |
| 314 | Low performance utility function for drawing a textured quad. Not intended |
| 315 | for drawing large quantities of geometry. |
| 316 | test: none |
| 317 | end: |
| 318 | |
| 319 | function: rsgDrawRect |
| 320 | size: 32 |
| 321 | ret: void |
| 322 | arg: float x1 |
| 323 | arg: float y1 |
| 324 | arg: float x2 |
| 325 | arg: float y2 |
| 326 | arg: float z |
| 327 | summary: |
| 328 | description: |
| 329 | Low performance utility function for drawing a simple rectangle. Not |
| 330 | intended for drawing large quantities of geometry. |
| 331 | test: none |
| 332 | end: |
| 333 | |
| 334 | function: rsgDrawSpriteScreenspace |
| 335 | size: 32 |
| 336 | ret: void |
| 337 | arg: float x |
| 338 | arg: float y |
| 339 | arg: float z |
| 340 | arg: float w |
| 341 | arg: float h |
| 342 | summary: |
| 343 | description: |
| 344 | Low performance function for drawing rectangles in screenspace. This |
| 345 | function uses the default passthough ProgramVertex. Any bound ProgramVertex |
| 346 | is ignored. This function has considerable overhead and should not be used |
| 347 | for drawing in shipping applications. |
| 348 | test: none |
| 349 | end: |
| 350 | |
| 351 | function: rsgDrawText |
| 352 | size: 32 |
| 353 | ret: void |
| 354 | arg: const char* text |
| 355 | arg: int x |
| 356 | arg: int y |
| 357 | summary: |
| 358 | description: |
| 359 | Draws text given a string and location |
| 360 | test: none |
| 361 | end: |
| 362 | |
| 363 | function: rsgDrawText |
| 364 | size: 32 |
| 365 | ret: void |
| 366 | arg: rs_allocation alloc |
| 367 | arg: int x |
| 368 | arg: int y |
| 369 | test: none |
| 370 | end: |
| 371 | |
| 372 | function: rsgFinish |
| 373 | version: 14 |
| 374 | size: 32 |
| 375 | ret: uint |
| 376 | summary: |
| 377 | description: |
| 378 | Force RenderScript to finish all rendering commands |
| 379 | test: none |
| 380 | end: |
| 381 | |
| 382 | function: rsgFontColor |
| 383 | size: 32 |
| 384 | ret: void |
| 385 | arg: float r, "red component" |
| 386 | arg: float g, "green component" |
| 387 | arg: float b, "blue component" |
| 388 | arg: float a, "alpha component" |
| 389 | summary: |
| 390 | description: |
| 391 | Sets the font color for all subsequent rendering calls |
| 392 | test: none |
| 393 | end: |
| 394 | |
| 395 | function: rsgGetHeight |
| 396 | size: 32 |
| 397 | ret: uint |
| 398 | summary: |
| 399 | description: |
| 400 | Get the height of the current rendering surface. |
| 401 | test: none |
| 402 | end: |
| 403 | |
| 404 | function: rsgGetWidth |
| 405 | size: 32 |
| 406 | ret: uint |
| 407 | summary: |
| 408 | description: |
| 409 | Get the width of the current rendering surface. |
| 410 | test: none |
| 411 | end: |
| 412 | |
| 413 | function: rsgMeasureText |
| 414 | size: 32 |
| 415 | ret: void |
| 416 | arg: const char* text |
| 417 | arg: int* left |
| 418 | arg: int* right |
| 419 | arg: int* top |
| 420 | arg: int* bottom |
| 421 | summary: |
| 422 | description: |
| 423 | Returns the bounding box of the text relative to (0, 0) |
| 424 | Any of left, right, top, bottom could be NULL |
| 425 | test: none |
| 426 | end: |
| 427 | |
| 428 | function: rsgMeasureText |
| 429 | size: 32 |
| 430 | ret: void |
| 431 | arg: rs_allocation alloc |
| 432 | arg: int* left |
| 433 | arg: int* right |
| 434 | arg: int* top |
| 435 | arg: int* bottom |
| 436 | test: none |
| 437 | end: |
| 438 | |
| 439 | function: rsgMeshComputeBoundingBox |
| 440 | size: 32 |
| 441 | ret: void |
| 442 | arg: rs_mesh mesh |
| 443 | arg: float* minX |
| 444 | arg: float* minY |
| 445 | arg: float* min |
| 446 | arg: float* maxX |
| 447 | arg: float* maxY |
| 448 | arg: float* maxZ |
| 449 | summary: |
| 450 | description: |
| 451 | Computes an axis aligned bounding box of a mesh object |
| 452 | test: none |
| 453 | end: |
| 454 | |
| 455 | function: rsgMeshComputeBoundingBox |
| 456 | size: 32 |
| 457 | attrib: always_inline |
| 458 | ret: void |
| 459 | arg: rs_mesh mesh |
| 460 | arg: float3* bBoxMin |
| 461 | arg: float3* bBoxMax |
| 462 | inline: |
| 463 | float x1, y1, z1, x2, y2, z2; |
| 464 | rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2); |
| 465 | bBoxMin->x = x1; |
| 466 | bBoxMin->y = y1; |
| 467 | bBoxMin->z = z1; |
| 468 | bBoxMax->x = x2; |
| 469 | bBoxMax->y = y2; |
| 470 | bBoxMax->z = z2; |
| 471 | test: none |
| 472 | end: |
| 473 | |
| 474 | |
| 475 | function: rsgProgramFragmentConstantColor |
| 476 | size: 32 |
| 477 | ret: void |
| 478 | arg: rs_program_fragment pf |
| 479 | arg: float r |
| 480 | arg: float g |
| 481 | arg: float b |
| 482 | arg: float a |
| 483 | summary: |
| 484 | description: |
| 485 | Set the constant color for a fixed function emulation program. |
| 486 | test: none |
| 487 | end: |
| 488 | |
| 489 | function: rsgProgramVertexGetProjectionMatrix |
| 490 | size: 32 |
| 491 | ret: void |
| 492 | arg: rs_matrix4x4* proj, "matrix to store the current projection matrix into" |
| 493 | summary: |
| 494 | description: |
| 495 | Get the projection matrix for a currently bound fixed function |
| 496 | vertex program. Calling this function with a custom vertex shader |
| 497 | would result in an error. |
| 498 | test: none |
| 499 | end: |
| 500 | |
| 501 | function: rsgProgramVertexLoadModelMatrix |
| 502 | size: 32 |
| 503 | ret: void |
| 504 | arg: const rs_matrix4x4* model, "model matrix" |
| 505 | summary: |
| 506 | description: |
| 507 | Load the model matrix for a currently bound fixed function |
| 508 | vertex program. Calling this function with a custom vertex shader |
| 509 | would result in an error. |
| 510 | test: none |
| 511 | end: |
| 512 | |
| 513 | function: rsgProgramVertexLoadProjectionMatrix |
| 514 | size: 32 |
| 515 | ret: void |
| 516 | arg: const rs_matrix4x4* proj, "projection matrix" |
| 517 | summary: |
| 518 | description: |
| 519 | Load the projection matrix for a currently bound fixed function |
| 520 | vertex program. Calling this function with a custom vertex shader |
| 521 | would result in an error. |
| 522 | test: none |
| 523 | end: |
| 524 | |
| 525 | function: rsgProgramVertexLoadTextureMatrix |
| 526 | size: 32 |
| 527 | ret: void |
| 528 | arg: const rs_matrix4x4* tex, "texture matrix" |
| 529 | summary: |
| 530 | description: |
| 531 | Load the texture matrix for a currently bound fixed function |
| 532 | vertex program. Calling this function with a custom vertex shader |
| 533 | would result in an error. |
| 534 | test: none |
| 535 | end: |
| 536 | |
Jason Sams | 41371c7 | 2015-03-26 20:46:57 +0000 | [diff] [blame^] | 537 | #endif //__LP64__ |