diff options
author | Jason Sams <rjsams@android.com> | 2010-06-01 15:47:01 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-06-01 15:47:01 -0700 |
commit | 8cb39de03aef6097a90033600d11a60ae000a6e4 (patch) | |
tree | cc9eb5fa87de5e14713684e7e177368d10550384 /libs/rs/rsScriptC_LibGL.cpp | |
parent | c9d0a87d504b3f0322b43f971f9cb4838ee521fb (diff) |
Remove RS_KIND from vertex arrays types.
Legacy vertex programs now bind by name just like the user programs.
This removes the need for two different ways of declairing the same
information.
Change-Id: I0178c0962842a1bbffb6726984ae1b8f5bb7529c
Diffstat (limited to 'libs/rs/rsScriptC_LibGL.cpp')
-rw-r--r-- | libs/rs/rsScriptC_LibGL.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/libs/rs/rsScriptC_LibGL.cpp b/libs/rs/rsScriptC_LibGL.cpp index 18f873ece2cb..8f650f84d06c 100644 --- a/libs/rs/rsScriptC_LibGL.cpp +++ b/libs/rs/rsScriptC_LibGL.cpp @@ -131,12 +131,8 @@ static void SC_drawLine(float x1, float y1, float z1, float vtx[] = { x1, y1, z1, x2, y2, z2 }; VertexArray va; - va.addLegacy(GL_FLOAT, 3, 12, RS_KIND_POSITION, false, (uint32_t)vtx); - if (rsc->checkVersion2_0()) { - va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); - } else { - va.setupGL(rsc, &rsc->mStateVertexArray); - } + va.add(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "position"); + va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); glDrawArrays(GL_LINES, 0, 2); } @@ -151,12 +147,8 @@ static void SC_drawPoint(float x, float y, float z) float vtx[] = { x, y, z }; VertexArray va; - va.addLegacy(GL_FLOAT, 3, 12, RS_KIND_POSITION, false, (uint32_t)vtx); - if (rsc->checkVersion2_0()) { - va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); - } else { - va.setupGL(rsc, &rsc->mStateVertexArray); - } + va.add(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "position"); + va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); glDrawArrays(GL_POINTS, 0, 1); } @@ -185,14 +177,9 @@ static void SC_drawQuadTexCoords(float x1, float y1, float z1, const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4}; VertexArray va; - va.addLegacy(GL_FLOAT, 3, 12, RS_KIND_POSITION, false, (uint32_t)vtx); - va.addLegacy(GL_FLOAT, 2, 8, RS_KIND_TEXTURE, false, (uint32_t)tex); - if (rsc->checkVersion2_0()) { - va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); - } else { - va.setupGL(rsc, &rsc->mStateVertexArray); - } - + va.add(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "position"); + va.add(GL_FLOAT, 2, 8, false, (uint32_t)tex, "texture0"); + va.setupGL2(rsc, &rsc->mStateVertexArray, &rsc->mShaderCache); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } |