aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrOpList.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-10-02 16:38:32 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-02 21:04:08 +0000
commit099fa0fb9801a138f12cf7cdf46b6581d81acce8 (patch)
tree2c3fcfa090c75737f528591095db6604d1f3ccce /src/gpu/GrOpList.cpp
parent74a8296d7c47efc6e23bd978efd1fdf4dbe29eb9 (diff)
Revert^6 "Make threaded proxy generation MDB-friendly, and defer instantiation"
ANGLE bots were getting lots of corrupted GMs - we set fPreferVRAMUseOverFlushes to false. In that case, multiple deferred proxies were instantiating to the same scratch resource. Any proxy that we're going to fill with an ASAP upload needs to have no pending IO - we hoist all those loads to the front of the flush, so normal IO tracking doesn't really help. Bug: skia: Change-Id: Id36fd8700e522db412a3c992b93c778e2ebb1188 Reviewed-on: https://skia-review.googlesource.com/53940 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrOpList.cpp')
-rw-r--r--src/gpu/GrOpList.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp
index 65d4e73fd0..59e1cd0f23 100644
--- a/src/gpu/GrOpList.cpp
+++ b/src/gpu/GrOpList.cpp
@@ -8,8 +8,9 @@
#include "GrOpList.h"
#include "GrContext.h"
-#include "GrPrepareCallback.h"
+#include "GrDeferredProxyUploader.h"
#include "GrSurfaceProxy.h"
+#include "GrTextureProxyPriv.h"
#include "SkAtomics.h"
@@ -57,17 +58,19 @@ void GrOpList::reset() {
}
fTarget.reset();
- fPrepareCallbacks.reset();
+ fDeferredProxies.reset();
fAuditTrail = nullptr;
}
-void GrOpList::addPrepareCallback(std::unique_ptr<GrPrepareCallback> callback) {
- fPrepareCallbacks.push_back(std::move(callback));
+void GrOpList::instantiateDeferredProxies(GrResourceProvider* resourceProvider) {
+ for (int i = 0; i < fDeferredProxies.count(); ++i) {
+ fDeferredProxies[i]->instantiate(resourceProvider);
+ }
}
void GrOpList::prepare(GrOpFlushState* flushState) {
- for (int i = 0; i < fPrepareCallbacks.count(); ++i) {
- (*fPrepareCallbacks[i])(flushState);
+ for (int i = 0; i < fDeferredProxies.count(); ++i) {
+ fDeferredProxies[i]->texPriv().scheduleUpload(flushState);
}
this->onPrepare(flushState);
@@ -100,6 +103,12 @@ void GrOpList::addDependency(GrSurfaceProxy* dependedOn, const GrCaps& caps) {
opList->makeClosed(caps);
}
}
+
+ if (GrTextureProxy* textureProxy = dependedOn->asTextureProxy()) {
+ if (textureProxy->texPriv().isDeferred()) {
+ fDeferredProxies.push_back(textureProxy);
+ }
+ }
}
#ifdef SK_DEBUG