13ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#ifndef __LP64__ 23ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams 35a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_core.rsh" 45a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_graphics.rsh" 55a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#include "rs_structs.h" 65a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines 75a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/** 85a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines* Mesh 95a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines*/ 105a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern uint32_t __attribute__((overloadable)) 115a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rsgMeshGetVertexAllocationCount(rs_mesh m) { 125a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines Mesh_t *mesh = (Mesh_t *)m.p; 135a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines if (mesh == NULL) { 145a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return 0; 155a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines } 165a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return mesh->mHal.state.vertexBuffersCount; 175a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} 185a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines 195a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern uint32_t __attribute__((overloadable)) 205a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rsgMeshGetPrimitiveCount(rs_mesh m) { 215a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines Mesh_t *mesh = (Mesh_t *)m.p; 225a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines if (mesh == NULL) { 235a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return 0; 245a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines } 255a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return mesh->mHal.state.primitivesCount; 265a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} 275a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines 285a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_allocation __attribute__((overloadable)) 295a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index) { 305a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines Mesh_t *mesh = (Mesh_t *)m.p; 315a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines if (mesh == NULL || index >= mesh->mHal.state.vertexBuffersCount) { 325a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rs_allocation nullAlloc = {0}; 335a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return nullAlloc; 345a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines } 355a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rs_allocation returnAlloc = {mesh->mHal.state.vertexBuffers[index]}; 365a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return returnAlloc; 375a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} 385a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines 395a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_allocation __attribute__((overloadable)) 405a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index) { 415a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines Mesh_t *mesh = (Mesh_t *)m.p; 425a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines if (mesh == NULL || index >= mesh->mHal.state.primitivesCount) { 435a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rs_allocation nullAlloc = {0}; 445a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return nullAlloc; 455a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines } 465a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rs_allocation returnAlloc = {mesh->mHal.state.indexBuffers[index]}; 475a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return returnAlloc; 485a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} 495a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines 505a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinesextern rs_primitive __attribute__((overloadable)) 515a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines rsgMeshGetPrimitive(rs_mesh m, uint32_t index) { 525a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines Mesh_t *mesh = (Mesh_t *)m.p; 535a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines if (mesh == NULL || index >= mesh->mHal.state.primitivesCount) { 545a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return RS_PRIMITIVE_INVALID; 555a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines } 565a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines return mesh->mHal.state.primitives[index]; 575a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} 583ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams 593ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#endif 603ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams 61