diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-09-27 10:29:47 -0700 |
|---|---|---|
| committer | Alex Sakhartchouk <alexst@google.com> | 2010-09-27 10:29:47 -0700 |
| commit | 0bd3c8621aeaab8d616ebf7644f9da3cce4bbde8 (patch) | |
| tree | 06b748fa1b29aeef0313e926cb5a896108f0be32 /rsVertexArray.cpp | |
| parent | b26fb04770442244233b630960f419cb154abc77 (diff) | |
| download | android_frameworks_rs-0bd3c8621aeaab8d616ebf7644f9da3cce4bbde8.tar.gz android_frameworks_rs-0bd3c8621aeaab8d616ebf7644f9da3cce4bbde8.tar.bz2 android_frameworks_rs-0bd3c8621aeaab8d616ebf7644f9da3cce4bbde8.zip | |
Error checking for MVP matrix computation.
Fixing more padding bugs.
Change-Id: Ic5d4260027b7dc86a50fdab7221c7296c7d3ea0d
Diffstat (limited to 'rsVertexArray.cpp')
| -rw-r--r-- | rsVertexArray.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/rsVertexArray.cpp b/rsVertexArray.cpp index 075a70da..16be5ea2 100644 --- a/rsVertexArray.cpp +++ b/rsVertexArray.cpp @@ -84,6 +84,10 @@ void VertexArray::clear(uint32_t n) void VertexArray::add(const Attrib &a, uint32_t stride) { + // Skip padding + if(a.name[0] == '#') { + return; + } rsAssert(mCount < RS_MAX_ATTRIBS); mAttribs[mCount].set(a); mAttribs[mCount].buffer = mActiveBuffer; @@ -94,6 +98,10 @@ void VertexArray::add(const Attrib &a, uint32_t stride) void VertexArray::add(uint32_t type, uint32_t size, uint32_t stride, bool normalized, uint32_t offset, const char *name) { + // Skip padding + if(name[0] == '#') { + return; + } rsAssert(mCount < RS_MAX_ATTRIBS); mAttribs[mCount].clear(); mAttribs[mCount].type = type; @@ -129,12 +137,7 @@ void VertexArray::setupGL2(const Context *rsc, class VertexArrayState *state, Sh rsc->checkError("VertexArray::setupGL2 disabled"); for (uint32_t ct=0; ct < mCount; ct++) { - int32_t slot = 0; - - if (mAttribs[ct].name[0] == '#') { - continue; - } - + int32_t slot = -1; if (sc->isUserVertexProgram()) { slot = sc->vtxAttribSlot(ct); } else { @@ -146,14 +149,11 @@ void VertexArray::setupGL2(const Context *rsc, class VertexArrayState *state, Sh slot = 2; } else if (mAttribs[ct].name == "texture0") { slot = 3; - } else { - continue; } } if(slot < 0) { continue; } - //logAttrib(ct, slot); glEnableVertexAttribArray(slot); glBindBuffer(GL_ARRAY_BUFFER, mAttribs[ct].buffer); |
