fix bug 3477451
Bogus asserts with pure compute scripts.
Change-Id: If5928c563e06405f75a11606d9148d64fa10be07
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index 1dfedb3..2e6ea12 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -270,19 +270,23 @@
Context::PushState::PushState(Context *con) {
mRsc = con;
- mFragment.set(con->getProgramFragment());
- mVertex.set(con->getProgramVertex());
- mStore.set(con->getProgramStore());
- mRaster.set(con->getProgramRaster());
- mFont.set(con->getFont());
+ if (con->mIsGraphicsContext) {
+ mFragment.set(con->getProgramFragment());
+ mVertex.set(con->getProgramVertex());
+ mStore.set(con->getProgramStore());
+ mRaster.set(con->getProgramRaster());
+ mFont.set(con->getFont());
+ }
}
Context::PushState::~PushState() {
- mRsc->setProgramFragment(mFragment.get());
- mRsc->setProgramVertex(mVertex.get());
- mRsc->setProgramStore(mStore.get());
- mRsc->setProgramRaster(mRaster.get());
- mRsc->setFont(mFont.get());
+ if (mRsc->mIsGraphicsContext) {
+ mRsc->setProgramFragment(mFragment.get());
+ mRsc->setProgramVertex(mVertex.get());
+ mRsc->setProgramStore(mStore.get());
+ mRsc->setProgramRaster(mRaster.get());
+ mRsc->setFont(mFont.get());
+ }
}