Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 | |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 17 | /** @file rs_mesh.rsh |
| 18 | * \brief Mesh routines |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef __RS_MESH_RSH__ |
| 24 | #define __RS_MESH_RSH__ |
| 25 | |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 26 | // New API's |
Alex Sakhartchouk | 3c0c606 | 2012-03-22 16:59:38 -0700 | [diff] [blame] | 27 | #if (defined(RS_VERSION) && (RS_VERSION >= 16)) |
| 28 | |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 29 | /** |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 30 | * Returns the number of allocations in the mesh that contain |
| 31 | * vertex data |
| 32 | * |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 33 | * @param m mesh to get data from |
| 34 | * @return number of allocations in the mesh that contain vertex |
| 35 | * data |
| 36 | */ |
| 37 | extern uint32_t __attribute__((overloadable)) |
Alex Sakhartchouk | f8e195e | 2012-03-22 10:50:55 -0700 | [diff] [blame] | 38 | rsgMeshGetVertexAllocationCount(rs_mesh m); |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 41 | * Meshes could have multiple index sets, this function returns |
| 42 | * the number. |
| 43 | * |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 44 | * @param m mesh to get data from |
| 45 | * @return number of primitive groups in the mesh. This would |
| 46 | * include simple primitives as well as allocations |
| 47 | * containing index data |
| 48 | */ |
| 49 | extern uint32_t __attribute__((overloadable)) |
Alex Sakhartchouk | f8e195e | 2012-03-22 10:50:55 -0700 | [diff] [blame] | 50 | rsgMeshGetPrimitiveCount(rs_mesh m); |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 53 | * Returns an allocation that is part of the mesh and contains |
| 54 | * vertex data, e.g. positions, normals, texcoords |
| 55 | * |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 56 | * @param m mesh to get data from |
| 57 | * @param index index of the vertex allocation |
| 58 | * @return allocation containing vertex data |
| 59 | */ |
| 60 | extern rs_allocation __attribute__((overloadable)) |
Alex Sakhartchouk | f8e195e | 2012-03-22 10:50:55 -0700 | [diff] [blame] | 61 | rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index); |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 64 | * Returns an allocation containing index data or a null |
| 65 | * allocation if only the primitive is specified |
| 66 | * |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 67 | * @param m mesh to get data from |
| 68 | * @param index index of the index allocation |
| 69 | * @return allocation containing index data |
| 70 | */ |
| 71 | extern rs_allocation __attribute__((overloadable)) |
Alex Sakhartchouk | f8e195e | 2012-03-22 10:50:55 -0700 | [diff] [blame] | 72 | rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index); |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 73 | |
| 74 | /** |
Alex Sakhartchouk | 340d15a | 2012-04-16 13:50:40 -0700 | [diff] [blame] | 75 | * Returns the primitive describing how a part of the mesh is |
| 76 | * rendered |
| 77 | * |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 78 | * @param m mesh to get data from |
| 79 | * @param index index of the primitive |
| 80 | * @return primitive describing how the mesh is rendered |
| 81 | */ |
| 82 | extern rs_primitive __attribute__((overloadable)) |
Alex Sakhartchouk | f8e195e | 2012-03-22 10:50:55 -0700 | [diff] [blame] | 83 | rsgMeshGetPrimitive(rs_mesh m, uint32_t index); |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 84 | |
Alex Sakhartchouk | 3c0c606 | 2012-03-22 16:59:38 -0700 | [diff] [blame] | 85 | #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) |
| 86 | |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 87 | #endif // __RS_MESH_RSH__ |
| 88 | |