summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgram.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2010-03-03 13:03:18 -0800
committer Jason Sams <rjsams@android.com> 2010-03-03 14:14:37 -0800
commit156cce698093023d9e79a4ff4fb96f4e4d3019db (patch)
treeff5ce34e453d2f475bcab35d29f5a7d00d53554d /libs/rs/rsProgram.cpp
parenta034cd3e15b6626be03e60f2d6a0f929dcb950d9 (diff)
Improve RS error handling. On errors RS will now store the error and a message that can be read from the app. RS will then not continue rendering frames while an unchecked error is present until new state is received.
Diffstat (limited to 'libs/rs/rsProgram.cpp')
-rw-r--r--libs/rs/rsProgram.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp
index 656a3c339529..478a6dcbcc21 100644
--- a/libs/rs/rsProgram.cpp
+++ b/libs/rs/rsProgram.cpp
@@ -39,6 +39,7 @@ Program::Program(Context *rsc) : ObjectBase(rsc)
mInputCount = 0;
mOutputCount = 0;
mConstantCount = 0;
+ mIsValid = false;
}
Program::Program(Context *rsc, const char * shaderText, uint32_t shaderLength,
@@ -216,6 +217,7 @@ bool Program::loadShader(Context *rsc, uint32_t type)
}
glDeleteShader(mShaderID);
mShaderID = 0;
+ rsc->setError(RS_ERROR_BAD_SHADER, "Error returned from GL driver loading shader text,");
return false;
}
}
@@ -224,6 +226,7 @@ bool Program::loadShader(Context *rsc, uint32_t type)
if (rsc->props.mLogShaders) {
LOGV("--Shader load result %x ", glGetError());
}
+ mIsValid = true;
return true;
}