blob: f22beaf6cd5cf23f44b3b7becc9e999b002b1a8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#ifndef __LP64__
#include "rs_core.rsh"
#include "rs_graphics.rsh"
#include "rs_structs.h"
/**
* Mesh
*/
extern uint32_t __attribute__((overloadable))
rsgMeshGetVertexAllocationCount(rs_mesh m) {
Mesh_t *mesh = (Mesh_t *)m.p;
if (mesh == NULL) {
return 0;
}
return mesh->mHal.state.vertexBuffersCount;
}
extern uint32_t __attribute__((overloadable))
rsgMeshGetPrimitiveCount(rs_mesh m) {
Mesh_t *mesh = (Mesh_t *)m.p;
if (mesh == NULL) {
return 0;
}
return mesh->mHal.state.primitivesCount;
}
extern rs_allocation __attribute__((overloadable))
rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index) {
Mesh_t *mesh = (Mesh_t *)m.p;
if (mesh == NULL || index >= mesh->mHal.state.vertexBuffersCount) {
rs_allocation nullAlloc = {0};
return nullAlloc;
}
rs_allocation returnAlloc = {mesh->mHal.state.vertexBuffers[index]};
rs_allocation rs_retval = {0};
rsSetObject(&rs_retval, returnAlloc);
return rs_retval;
}
extern rs_allocation __attribute__((overloadable))
rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index) {
Mesh_t *mesh = (Mesh_t *)m.p;
if (mesh == NULL || index >= mesh->mHal.state.primitivesCount) {
rs_allocation nullAlloc = {0};
return nullAlloc;
}
rs_allocation returnAlloc = {mesh->mHal.state.indexBuffers[index]};
rs_allocation rs_retval = {0};
rsSetObject(&rs_retval, returnAlloc);
return rs_retval;
}
extern rs_primitive __attribute__((overloadable))
rsgMeshGetPrimitive(rs_mesh m, uint32_t index) {
Mesh_t *mesh = (Mesh_t *)m.p;
if (mesh == NULL || index >= mesh->mHal.state.primitivesCount) {
return RS_PRIMITIVE_INVALID;
}
return mesh->mHal.state.primitives[index];
}
#endif
|