summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsProgramVertex.cpp
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-10-06 11:15:01 -0700
committerAlex Sakhartchouk <alexst@google.com>2010-10-06 11:15:01 -0700
commitd2091639be426574c04f74969fe553162d7a51c9 (patch)
tree29be1a27b9724fb95d53d127771fa38016929fe3 /libs/rs/rsProgramVertex.cpp
parent76322af2a6c109a79431f019dcef6e038c030686 (diff)
downloadframeworks_base-d2091639be426574c04f74969fe553162d7a51c9.zip
frameworks_base-d2091639be426574c04f74969fe553162d7a51c9.tar.gz
frameworks_base-d2091639be426574c04f74969fe553162d7a51c9.tar.bz2
changing vec4 to vec2 for perf reasons.
Change-Id: Ic885a6dc697af4fd82e184158772863673f041bd
Diffstat (limited to 'libs/rs/rsProgramVertex.cpp')
-rw-r--r--libs/rs/rsProgramVertex.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp
index d3dbfb2..a785262 100644
--- a/libs/rs/rsProgramVertex.cpp
+++ b/libs/rs/rsProgramVertex.cpp
@@ -242,6 +242,7 @@ ProgramVertexState::~ProgramVertexState()
void ProgramVertexState::init(Context *rsc)
{
const Element *matrixElem = Element::create(rsc, RS_TYPE_MATRIX_4X4, RS_KIND_USER, false, 1);
+ const Element *f2Elem = Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 2);
const Element *f3Elem = Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 3);
const Element *f4Elem = Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 4);
@@ -256,7 +257,7 @@ void ProgramVertexState::init(Context *rsc)
rsc->mStateElement.elementBuilderAdd(f4Elem, "position", 1);
rsc->mStateElement.elementBuilderAdd(f4Elem, "color", 1);
rsc->mStateElement.elementBuilderAdd(f3Elem, "normal", 1);
- rsc->mStateElement.elementBuilderAdd(f4Elem, "texture0", 1);
+ rsc->mStateElement.elementBuilderAdd(f2Elem, "texture0", 1);
const Element *attrElem = rsc->mStateElement.elementBuilderCreate(rsc);
Type *inputType = new Type(rsc);
@@ -266,7 +267,7 @@ void ProgramVertexState::init(Context *rsc)
String8 shaderString(RS_SHADER_INTERNAL);
shaderString.append("varying vec4 varColor;\n");
- shaderString.append("varying vec4 varTex0;\n");
+ shaderString.append("varying vec2 varTex0;\n");
shaderString.append("void main() {\n");
shaderString.append(" gl_Position = UNI_MVP * ATTRIB_position;\n");
shaderString.append(" gl_PointSize = 1.0;\n");