diff options
| author | Jason Sams <rjsams@android.com> | 2009-10-26 15:19:28 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2009-10-26 15:20:43 -0700 |
| commit | 5c3e3bc8af6de6be5e6bd68e1d5168496f99e6cf (patch) | |
| tree | 407a4826cf7fb8518d7bbe4c58ccd1d32177fa4d /rsProgram.cpp | |
| parent | c2f94902d454ac724c4d7b5246373ca0ff2c99d1 (diff) | |
Fix dirty state tracking of allocation attached to ProgramVertex objects when being updated while not attached.
Diffstat (limited to 'rsProgram.cpp')
| -rw-r--r-- | rsProgram.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rsProgram.cpp b/rsProgram.cpp index 5f2a6097..ed5918b7 100644 --- a/rsProgram.cpp +++ b/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; - } -} |
