Beging GL2 user shaders. Switch master to using GL2 by default.
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp
index 1776b02b..482739c 100644
--- a/libs/rs/rsProgramVertex.cpp
+++ b/libs/rs/rsProgramVertex.cpp
@@ -117,18 +117,24 @@
mShader.append("varying vec4 varColor;\n");
mShader.append("varying vec4 varTex0;\n");
- mShader.append("void main() {\n");
- mShader.append(" gl_Position = uni_MVP * attrib_Position;\n");
- mShader.append(" varColor = attrib_Color;\n");
- if (mTextureMatrixEnable) {
- mShader.append(" varTex0 = uni_TexMatrix * attrib_T0;\n");
+ if (mUserShader.length() > 1) {
+ mShader.append(mUserShader);
} else {
- mShader.append(" varTex0 = attrib_T0;\n");
+ mShader.append("void main() {\n");
+ mShader.append(" gl_Position = uni_MVP * attrib_Position;\n");
+ mShader.append(" gl_PointSize = attrib_PointSize.x;\n");
+
+ mShader.append(" varColor = attrib_Color;\n");
+ if (mTextureMatrixEnable) {
+ mShader.append(" varTex0 = uni_TexMatrix * attrib_T0;\n");
+ } else {
+ mShader.append(" varTex0 = attrib_T0;\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");
}
- //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");
}
void ProgramVertex::setupGL2(const Context *rsc, ProgramVertexState *state, ShaderCache *sc)
@@ -211,7 +217,6 @@
createShader();
}
-
///////////////////////////////////////////////////////////////////////
ProgramVertexState::ProgramVertexState()
@@ -294,6 +299,11 @@
rsc->mStateVertex.mPV->setTextureMatrixEnable(enable);
}
+void rsi_ProgramVertexSetShader(Context *rsc, const char *txt, uint32_t len)
+{
+ rsc->mStateVertex.mPV->setShader(txt, len);
+}
+
void rsi_ProgramVertexAddLight(Context *rsc, RsLight light)
{
rsc->mStateVertex.mPV->addLight(static_cast<const Light *>(light));