summaryrefslogtreecommitdiff
path: root/libs/rs/rsFBOCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsFBOCache.cpp')
-rw-r--r--libs/rs/rsFBOCache.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/rs/rsFBOCache.cpp b/libs/rs/rsFBOCache.cpp
index c5c64c27b602..f4a8bc6d7b30 100644
--- a/libs/rs/rsFBOCache.cpp
+++ b/libs/rs/rsFBOCache.cpp
@@ -26,11 +26,14 @@ using namespace android::renderscript;
FBOCache::FBOCache() {
mDirty = true;
mHal.state.colorTargetsCount = 1;
- mHal.state.colorTargets = new ObjectBaseRef<Allocation>[mHal.state.colorTargetsCount];
+ mHal.state.colorTargets = new Allocation*[mHal.state.colorTargetsCount];
+ mColorTargets = new ObjectBaseRef<Allocation>[mHal.state.colorTargetsCount];
+ resetAll(NULL);
}
FBOCache::~FBOCache() {
delete[] mHal.state.colorTargets;
+ delete[] mColorTargets;
}
void FBOCache::init(Context *rsc) {
@@ -52,7 +55,8 @@ void FBOCache::bindColorTarget(Context *rsc, Allocation *a, uint32_t slot) {
return;
}
}
- mHal.state.colorTargets[slot].set(a);
+ mColorTargets[slot].set(a);
+ mHal.state.colorTargets[slot] = a;
mDirty = true;
}
@@ -63,15 +67,18 @@ void FBOCache::bindDepthTarget(Context *rsc, Allocation *a) {
return;
}
}
- mHal.state.depthTarget.set(a);
+ mDepthTarget.set(a);
+ mHal.state.depthTarget = a;
mDirty = true;
}
void FBOCache::resetAll(Context *) {
for (uint32_t i = 0; i < mHal.state.colorTargetsCount; i ++) {
- mHal.state.colorTargets[i].set(NULL);
+ mColorTargets[i].set(NULL);
+ mHal.state.colorTargets[i] = NULL;
}
- mHal.state.depthTarget.set(NULL);
+ mDepthTarget.set(NULL);
+ mHal.state.depthTarget = NULL;
mDirty = true;
}