Track all sampled textures in GrOpsTask and pass them to GrOpsRenderPass.
In Vulkan we use this list to set the layout for these surface to be
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL at GrOpsRenderPass creation
instead of at submit. This gets us closer to being able to run with
primary or secondary command buffers.
Change-Id: I6e307485987e2c024ed9ecba3e41f588047c5f07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238444
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index 4ad6cd9..1d7642e 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -414,6 +414,15 @@
SkASSERT(fInstanceRanges.back().fAtlasProxy == atlasProxy);
}
+void GrCCDrawPathsOp::onPrepare(GrOpFlushState* flushState) {
+ // The CCPR ops don't know their atlas textures until after the preFlush calls have been
+ // executed at the start GrDrawingManger::flush. Thus the proxies are not added during the
+ // normal visitProxies calls doing addDrawOp. Therefore, the atlas proxies are added now.
+ for (const InstanceRange& range : fInstanceRanges) {
+ flushState->sampledProxyArray()->push_back(range.fAtlasProxy);
+ }
+}
+
void GrCCDrawPathsOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
SkASSERT(fOwningPerOpsTaskPaths);