diff options
Diffstat (limited to 'libs/rs/rsProgram.cpp')
-rw-r--r-- | libs/rs/rsProgram.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp index 5f2a609..ed5918b 100644 --- a/libs/rs/rsProgram.cpp +++ b/libs/rs/rsProgram.cpp @@ -32,19 +32,23 @@ Program::Program(Context *rsc, Element *in, Element *out) : ObjectBase(rsc) Program::~Program() { + bindAllocation(NULL); } void Program::bindAllocation(Allocation *alloc) { + if (mConstants.get() == alloc) { + return; + } + if (mConstants.get()) { + mConstants.get()->removeProgramToDirty(this); + } mConstants.set(alloc); + if (alloc) { + alloc->addProgramToDirty(this); + } mDirty = true; } -void Program::checkUpdatedAllocation(const Allocation *alloc) -{ - if (mConstants.get() == alloc) { - mDirty = true; - } -} |