DescriptionChasing some test failures that occurred after the recent mipmap/subimage changes, I found the following bug. I think it's always been wrong, but only became symptomatic after that change.
The short story is that I was sloppy about sometimes using m_invalid, and other times m_subimages.size()>0 as tests for whether the specs were read and valid, but wasn't in fact ensuring that they always were in sync. This caused some very subtle problems after files were invalidated, cascading into using a spec that was no longer valid memory. This patch refactors a bit and fixes it up. I believe it was a problem all along, but the memory was being reused "in place" before, so the values were still as expected.
The one trick to it all is that in eliminating the inconsistency, in invalidate() I no longer re-open and re-close the file. I can't think of a good reason to do that now, but obviously at some point I thought it was necessary. We pass all tests (including OSL and Arnold testsuites), so I don't think this breaks anything, but I want you reviewers to think hard about whether I'm forgetting something.
Patch Set 1 #
Total comments: 4
MessagesTotal messages: 3
|