diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-29 12:37:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-29 17:04:51 +0000 |
commit | 9bee2e5894bb8dd374392f238bc429e16f239583 (patch) | |
tree | 975ace2218b6911b62c9c9abceb2545cba9e5150 /src/gpu/GrProcessor.cpp | |
parent | 761717146923163991aeb32d50f05a2bdf471dc4 (diff) |
Revise system for checking for uninstantiated proxies
The new pattern is:
we will "instantiate" pipelines at flush time
at flush time we will only access the backing GrSurface by peeking
If instantiation fails we should never try to access the GrSurfaces
Change-Id: I87f7ff41bd0e84d9ca3dbdd61d3361d3d4ceefd6
Reviewed-on: https://skia-review.googlesource.com/17932
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.cpp')
-rw-r--r-- | src/gpu/GrProcessor.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp index c20ebabfb5..6895eaa393 100644 --- a/src/gpu/GrProcessor.cpp +++ b/src/gpu/GrProcessor.cpp @@ -129,12 +129,6 @@ void GrProcessor::operator delete(void* target) { /////////////////////////////////////////////////////////////////////////////// void GrResourceIOProcessor::addTextureSampler(const TextureSampler* access) { - // MDB TODO: this 'isBad' call checks to ensure the underlying texture exists. It needs to - // be moved later. - if (access->isBad()) { - this->markAsBad(); - } - fTextureSamplers.push_back(access); } @@ -144,11 +138,6 @@ void GrResourceIOProcessor::addBufferAccess(const BufferAccess* access) { void GrResourceIOProcessor::addImageStorageAccess(GrResourceProvider* resourceProvider, const ImageStorageAccess* access) { - // MDB TODO: this 'isBad' call attempts to instantiate 'access'. It needs to be moved later. - if (access->isBad(resourceProvider)) { - this->markAsBad(); - } - fImageStorageAccesses.push_back(access); } @@ -188,6 +177,22 @@ void GrResourceIOProcessor::pendingIOComplete() const { } } +bool GrResourceIOProcessor::instantiate(GrResourceProvider* resourceProvider) const { + for (const auto& sampler : fTextureSamplers) { + if (!sampler->instantiate(resourceProvider)) { + return false; + } + } + + for (const auto& imageStorage : fImageStorageAccesses) { + if (!imageStorage->instantiate(resourceProvider)) { + return false; + } + } + + return true; +} + bool GrResourceIOProcessor::hasSameSamplersAndAccesses(const GrResourceIOProcessor& that) const { if (this->numTextureSamplers() != that.numTextureSamplers() || this->numBuffers() != that.numBuffers() || |