diff options
author | Jason Sams <rjsams@android.com> | 2010-07-09 15:34:32 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-07-09 15:34:32 -0700 |
commit | 53a93d5e917038504ba4422e4ad346ae37131365 (patch) | |
tree | 87e761cec60c13650f753382148ce10e64d18321 /libs | |
parent | 82164ad543b4eb6c11937b2a81891443317709cc (diff) | |
download | frameworks_base-53a93d5e917038504ba4422e4ad346ae37131365.zip frameworks_base-53a93d5e917038504ba4422e4ad346ae37131365.tar.gz frameworks_base-53a93d5e917038504ba4422e4ad346ae37131365.tar.bz2 |
Remove points from fixed function.
Add basic GL performance test.
Change-Id: I421a41b6683b2c5f70045cdd0f610a6939105fee
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/rs.spec | 5 | ||||
-rw-r--r-- | libs/rs/rsProgramRaster.cpp | 16 | ||||
-rw-r--r-- | libs/rs/rsProgramRaster.h | 5 | ||||
-rw-r--r-- | libs/rs/rsProgramVertex.cpp | 6 | ||||
-rw-r--r-- | libs/rs/rsShaderCache.cpp | 3 | ||||
-rw-r--r-- | libs/rs/rsVertexArray.cpp | 4 | ||||
-rw-r--r-- | libs/rs/scriptc/rs_math.rsh | 17 |
7 files changed, 21 insertions, 35 deletions
diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec index 136c05d..80047c1 100644 --- a/libs/rs/rs.spec +++ b/libs/rs/rs.spec @@ -360,11 +360,6 @@ ProgramRasterSetLineWidth { param float lw } -ProgramRasterSetPointSize{ - param RsProgramRaster pr - param float ps -} - ProgramBindConstants { param RsProgram vp diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp index 66f6ef8..7663840 100644 --- a/libs/rs/rsProgramRaster.cpp +++ b/libs/rs/rsProgramRaster.cpp @@ -41,8 +41,6 @@ ProgramRaster::ProgramRaster(Context *rsc, mPointSmooth = pointSmooth; mLineSmooth = lineSmooth; mPointSprite = pointSprite; - - mPointSize = 1.0f; mLineWidth = 1.0f; } @@ -55,11 +53,6 @@ void ProgramRaster::setLineWidth(float s) mLineWidth = s; } -void ProgramRaster::setPointSize(float s) -{ - mPointSize = s; -} - void ProgramRaster::setupGL(const Context *rsc, ProgramRasterState *state) { if (state->mLast.get() == this) { @@ -67,7 +60,6 @@ void ProgramRaster::setupGL(const Context *rsc, ProgramRasterState *state) } state->mLast.set(this); - glPointSize(mPointSize); if (mPointSmooth) { glEnable(GL_POINT_SMOOTH); } else { @@ -102,7 +94,7 @@ void ProgramRaster::setupGL2(const Context *rsc, ProgramRasterState *state) void ProgramRaster::serialize(OStream *stream) const { - + } ProgramRaster *ProgramRaster::createFromStream(Context *rsc, IStream *stream) @@ -147,12 +139,6 @@ RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, RsElement in, RsElement o return pr; } -void rsi_ProgramRasterSetPointSize(Context * rsc, RsProgramRaster vpr, float s) -{ - ProgramRaster *pr = static_cast<ProgramRaster *>(vpr); - pr->setPointSize(s); -} - void rsi_ProgramRasterSetLineWidth(Context * rsc, RsProgramRaster vpr, float s) { ProgramRaster *pr = static_cast<ProgramRaster *>(vpr); diff --git a/libs/rs/rsProgramRaster.h b/libs/rs/rsProgramRaster.h index 79b1475..ea78e766 100644 --- a/libs/rs/rsProgramRaster.h +++ b/libs/rs/rsProgramRaster.h @@ -41,17 +41,12 @@ public: static ProgramRaster *createFromStream(Context *rsc, IStream *stream); void setLineWidth(float w); - void setPointSize(float s); protected: bool mPointSmooth; bool mLineSmooth; bool mPointSprite; - - float mPointSize; float mLineWidth; - - }; class ProgramRasterState diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index 85d90c7..5558007 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/rsProgramVertex.cpp @@ -191,7 +191,6 @@ void ProgramVertex::createShader() mShader.append("attribute vec4 ATTRIB_position;\n"); mShader.append("attribute vec4 ATTRIB_color;\n"); mShader.append("attribute vec3 ATTRIB_normal;\n"); - mShader.append("attribute float ATTRIB_pointSize;\n"); mShader.append("attribute vec4 ATTRIB_texture0;\n"); for (uint32_t ct=0; ct < mUniformCount; ct++) { @@ -202,7 +201,7 @@ void ProgramVertex::createShader() mShader.append("void main() {\n"); mShader.append(" gl_Position = UNI_MVP * ATTRIB_position;\n"); - mShader.append(" gl_PointSize = ATTRIB_pointSize;\n"); + mShader.append(" gl_PointSize = 1.0;\n"); mShader.append(" varColor = ATTRIB_color;\n"); if (mTextureMatrixEnable) { @@ -210,9 +209,6 @@ void ProgramVertex::createShader() } else { mShader.append(" varTex0 = ATTRIB_texture0;\n"); } - //mShader.append(" pos.x = pos.x / 480.0;\n"); - //mShader.append(" pos.y = pos.y / 800.0;\n"); - //mShader.append(" gl_Position = pos;\n"); mShader.append("}\n"); } } diff --git a/libs/rs/rsShaderCache.cpp b/libs/rs/rsShaderCache.cpp index 504ffba..5c073b3 100644 --- a/libs/rs/rsShaderCache.cpp +++ b/libs/rs/rsShaderCache.cpp @@ -101,8 +101,7 @@ bool ShaderCache::lookup(Context *rsc, ProgramVertex *vtx, ProgramFragment *frag glBindAttribLocation(pgm, 0, "ATTRIB_position"); glBindAttribLocation(pgm, 1, "ATTRIB_color"); glBindAttribLocation(pgm, 2, "ATTRIB_normal"); - glBindAttribLocation(pgm, 3, "ATTRIB_pointSize"); - glBindAttribLocation(pgm, 4, "ATTRIB_texture0"); + glBindAttribLocation(pgm, 3, "ATTRIB_texture0"); } //LOGE("e2 %x", glGetError()); diff --git a/libs/rs/rsVertexArray.cpp b/libs/rs/rsVertexArray.cpp index 6937a85..001927c 100644 --- a/libs/rs/rsVertexArray.cpp +++ b/libs/rs/rsVertexArray.cpp @@ -144,10 +144,8 @@ void VertexArray::setupGL2(const Context *rsc, class VertexArrayState *state, Sh slot = 1; } else if (mAttribs[ct].name == "normal") { slot = 2; - } else if (mAttribs[ct].name == "pointSize") { - slot = 3; } else if (mAttribs[ct].name == "texture0") { - slot = 4; + slot = 3; } else { continue; } diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh index 3709296..4390a5d 100644 --- a/libs/rs/scriptc/rs_math.rsh +++ b/libs/rs/scriptc/rs_math.rsh @@ -48,6 +48,23 @@ extern int64_t rsElapsedTimeMillis(); extern int rsSendToClient(void *data, int cmdID, int len, int waitForSpace); // Script to Script +typedef struct rs_script_call_rec { + rs_script script; + rs_allocation input; + rs_allocation output; + + uint32_t xStart; + uint32_t xEnd; + uint32_t yStart; + uint32_t yEnd; + uint32_t zStart; + uint32_t zEnd; + uint32_t arrayStart; + uint32_t arrayEnd; + + const void * usrData; +} rs_script_call; + extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input); extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, rs_allocation output); extern void __attribute__((overloadable))rsForEach(rs_script, rs_allocation input, int xStart, int xEnd); |