summaryrefslogtreecommitdiff
path: root/libs/rs/rsShaderCache.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/rsShaderCache.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/rsShaderCache.cpp')
-rw-r--r--libs/rs/rsShaderCache.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/rs/rsShaderCache.cpp b/libs/rs/rsShaderCache.cpp
index 3a1f37092500..4711d1b1ebf8 100644
--- a/libs/rs/rsShaderCache.cpp
+++ b/libs/rs/rsShaderCache.cpp
@@ -123,6 +123,8 @@ bool ShaderCache::lookup(Context *rsc, ProgramVertex *vtx, ProgramFragment *frag
}
}
glDeleteProgram(pgm);
+ rsc->setError(RS_ERROR_BAD_SHADER, "Error linking GL Programs");
+ return false;
}
if (vtx->isUserProgram()) {
for (uint32_t ct=0; ct < vtx->getAttribCount(); ct++) {
@@ -146,6 +148,7 @@ bool ShaderCache::lookup(Context *rsc, ProgramVertex *vtx, ProgramFragment *frag
}
}
+ e->mIsValid = true;
//LOGV("SC made program %i", e->program);
glUseProgram(e->program);
mEntryCount++;