From 156cce698093023d9e79a4ff4fb96f4e4d3019db Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Wed, 3 Mar 2010 13:03:18 -0800 Subject: 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. --- libs/rs/rsProgram.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/rs/rsProgram.cpp') 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; } -- cgit v1.2.3-59-g8ed1b