diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-07-02 12:14:26 -0700 |
|---|---|---|
| committer | Alex Sakhartchouk <alexst@google.com> | 2010-07-02 12:14:26 -0700 |
| commit | 17d72e835b5b2bb0baa928fe63bb76d263c63916 (patch) | |
| tree | 0e19d5a1916e046f3da170de216d3ecd4266b3f6 /rsMesh.cpp | |
| parent | 4e9a7a8ded109e16b163789274899447cef02642 (diff) | |
| download | android_frameworks_rs-17d72e835b5b2bb0baa928fe63bb76d263c63916.tar.gz android_frameworks_rs-17d72e835b5b2bb0baa928fe63bb76d263c63916.tar.bz2 android_frameworks_rs-17d72e835b5b2bb0baa928fe63bb76d263c63916.zip | |
Cleanup pass on the mesh api change.
Removed all the simple mesh related calls and temporary objects.
Change-Id: Ic64a72a894e0314f216f10e1cfc0d45b17e2e182
Diffstat (limited to 'rsMesh.cpp')
| -rw-r--r-- | rsMesh.cpp | 89 |
1 files changed, 0 insertions, 89 deletions
@@ -38,16 +38,11 @@ Mesh::Mesh(Context *rsc) : ObjectBase(rsc) mPrimitives = NULL; mPrimitivesCount = 0; mVertexBuffers = NULL; - mVertexTypes = NULL; mVertexBufferCount = 0; } Mesh::~Mesh() { - if(mVertexTypes) { - delete[] mVertexTypes; - } - if(mVertexBuffers) { delete[] mVertexBuffers; } @@ -80,11 +75,6 @@ void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const { return; } - if (prim->mPrimitiveBuffer.get()) { - renderPrimitiveRange(rsc, primIndex, 0, prim->mPrimitiveBuffer->getType()->getDimX()); - return; - } - renderPrimitiveRange(rsc, primIndex, 0, mVertexBuffers[0]->getType()->getDimX()); } @@ -133,9 +123,6 @@ void Mesh::uploadAll(Context *rsc) if (mPrimitives[ct]->mIndexBuffer.get()) { mPrimitives[ct]->mIndexBuffer->deferedUploadToBufferObject(rsc); } - if (mPrimitives[ct]->mPrimitiveBuffer.get()) { - mPrimitives[ct]->mPrimitiveBuffer->deferedUploadToBufferObject(rsc); - } } rsc->checkError("Mesh::uploadAll"); @@ -183,14 +170,6 @@ void Mesh::serialize(OStream *stream) const else { stream->addU32(0); } - - if(prim->mPrimitiveBuffer.get()) { - stream->addU32(1); - prim->mPrimitiveBuffer->serialize(stream); - } - else { - stream->addU32(0); - } } } @@ -236,13 +215,6 @@ Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) Allocation *indexAlloc = Allocation::createFromStream(rsc, stream); prim->mIndexBuffer.set(indexAlloc); } - - // Check to see if the primitive buffer was stored - uint32_t isPrimitivePresent = stream->loadU32(); - if(isPrimitivePresent) { - Allocation *primitiveAlloc = Allocation::createFromStream(rsc, stream); - prim->mPrimitiveBuffer.set(primitiveAlloc); - } } } @@ -277,7 +249,6 @@ RsMesh rsi_MeshCreate(Context *rsc, uint32_t vtxCount, uint32_t idxCount) sm->mVertexBufferCount = vtxCount; sm->mVertexBuffers = new ObjectBaseRef<Allocation>[vtxCount]; - sm->mVertexTypes = new ObjectBaseRef<const Type>[vtxCount]; return sm; } @@ -300,64 +271,4 @@ void rsi_MeshBindIndex(Context *rsc, RsMesh mv, RsAllocation va, uint32_t primTy sm->updateGLPrimitives(); } -void rsi_MeshBindPrimitive(Context *rsc, RsMesh mv, RsAllocation va, uint32_t primType, uint32_t slot) -{ - Mesh *sm = static_cast<Mesh *>(mv); - rsAssert(slot < sm->mPrimitivesCount); - - sm->mPrimitives[slot]->mPrimitiveBuffer.set((Allocation *)va); - sm->mPrimitives[slot]->mPrimitive = (RsPrimitive)primType; - sm->updateGLPrimitives(); -} - - -// Route all the simple mesh through mesh - -RsMesh rsi_SimpleMeshCreate(Context *rsc, RsType prim, RsType idx, RsType *vtx, uint32_t vtxCount, uint32_t primType) -{ - Mesh *sm = new Mesh(rsc); - sm->incUserRef(); - - sm->mPrimitivesCount = 1; - sm->mPrimitives = new Mesh::Primitive_t *[sm->mPrimitivesCount]; - sm->mPrimitives[0] = new Mesh::Primitive_t; - - sm->mPrimitives[0]->mIndexType.set((const Type *)idx); - sm->mPrimitives[0]->mPrimitiveType.set((const Type *)prim); - sm->mPrimitives[0]->mPrimitive = (RsPrimitive)primType; - sm->updateGLPrimitives(); - - sm->mVertexBufferCount = vtxCount; - sm->mVertexTypes = new ObjectBaseRef<const Type>[vtxCount]; - sm->mVertexBuffers = new ObjectBaseRef<Allocation>[vtxCount]; - for (uint32_t ct=0; ct < vtxCount; ct++) { - sm->mVertexTypes[ct].set((const Type *)vtx[ct]); - } - - return sm; -} - -void rsi_SimpleMeshBindVertex(Context *rsc, RsMesh mv, RsAllocation va, uint32_t slot) -{ - Mesh *sm = static_cast<Mesh *>(mv); - rsAssert(slot < sm->mVertexBufferCount); - - sm->mVertexBuffers[slot].set((Allocation *)va); -} - -void rsi_SimpleMeshBindIndex(Context *rsc, RsMesh mv, RsAllocation va) -{ - Mesh *sm = static_cast<Mesh *>(mv); - sm->mPrimitives[0]->mIndexBuffer.set((Allocation *)va); -} - -void rsi_SimpleMeshBindPrimitive(Context *rsc, RsMesh mv, RsAllocation va) -{ - Mesh *sm = static_cast<Mesh *>(mv); - sm->mPrimitives[0]->mPrimitiveBuffer.set((Allocation *)va); -} - - - - }} |
