Reland "Initiate MSAA resolves during DAG generation"
This is a reland of 804f6a0fe7f3c7df5ac69891841ee9cdf6d1121a
Original change's description:
> Initiate MSAA resolves during DAG generation
>
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
>
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
>
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:
Change-Id: I805b3af1404eb7919ae937cff3dfa97921e32c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237482
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.h b/src/gpu/GrRenderTargetProxy.h
index 3371850..1d40efd 100644
--- a/src/gpu/GrRenderTargetProxy.h
+++ b/src/gpu/GrRenderTargetProxy.h
@@ -63,6 +63,19 @@
bool wrapsVkSecondaryCB() const { return fWrapsVkSecondaryCB == WrapsVkSecondaryCB::kYes; }
+ void markMSAADirty() {
+ SkASSERT(this->requiresManualMSAAResolve());
+ fIsMSAADirty = true;
+ }
+ void markMSAAResolved() {
+ SkASSERT(this->requiresManualMSAAResolve());
+ fIsMSAADirty = false;
+ }
+ bool isMSAADirty() const {
+ SkASSERT(!fIsMSAADirty || this->requiresManualMSAAResolve());
+ return fIsMSAADirty;
+ }
+
// TODO: move this to a priv class!
bool refsWrappedObjects() const;
@@ -128,6 +141,10 @@
int8_t fNumStencilSamples = 0;
WrapsVkSecondaryCB fWrapsVkSecondaryCB;
GrSwizzle fOutputSwizzle;
+ // Indicates whether some sub-rectangle of the render target requires MSAA resolve. We currently
+ // rely on the GrRenderTarget itself to track the actual dirty rect.
+ // TODO: In the future, convert the flag to a dirty rect and quit tracking it in GrRenderTarget.
+ bool fIsMSAADirty = false;
// This is to fix issue in large comment above. Without the padding we end 6 bytes into a 16
// byte range, so the GrTextureProxy ends up starting 8 byte aligned by not 16. We add the
// padding here to get us right up to the 16 byte alignment (technically any padding of 3-10