Revert "Initiate MSAA resolves during DAG generation"
This reverts commit 804f6a0fe7f3c7df5ac69891841ee9cdf6d1121a.
Reason for revert: <INSERT REASONING HERE>
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>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com
Change-Id: Ife557caa840edfb64cbcafc272dc3012cfb43702
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237242
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrTextureResolveRenderTask.cpp b/src/gpu/GrTextureResolveRenderTask.cpp
index 0064fe6..1e52b87 100644
--- a/src/gpu/GrTextureResolveRenderTask.cpp
+++ b/src/gpu/GrTextureResolveRenderTask.cpp
@@ -10,7 +10,6 @@
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrOpFlushState.h"
-#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrResourceAllocator.h"
#include "src/gpu/GrTexturePriv.h"
@@ -20,24 +19,6 @@
sk_sp<GrTextureResolveRenderTask> resolveTask(
new GrTextureResolveRenderTask(std::move(textureProxy), flags));
- // Ensure the last render task that operated on the textureProxy is closed. That's where msaa
- // and mipmaps should have been marked dirty.
- SkASSERT(!textureProxyPtr->getLastRenderTask() ||
- textureProxyPtr->getLastRenderTask()->isClosed());
-
- if (GrTextureResolveFlags::kMSAA & flags) {
- GrRenderTargetProxy* renderTargetProxy = textureProxyPtr->asRenderTargetProxy();
- SkASSERT(renderTargetProxy);
- SkASSERT(renderTargetProxy->isMSAADirty());
- renderTargetProxy->markMSAAResolved();
- }
-
- if (GrTextureResolveFlags::kMipMaps & flags) {
- SkASSERT(GrMipMapped::kYes == textureProxyPtr->mipMapped());
- SkASSERT(textureProxyPtr->mipMapsAreDirty());
- textureProxyPtr->markMipMapsClean();
- }
-
// Add the target as a dependency: We will read the existing contents of this texture while
// generating mipmap levels and/or resolving MSAA.
//
@@ -49,7 +30,13 @@
// We only resolve the texture; nobody should try to do anything else with this opsTask.
resolveTask->makeClosed(caps);
- return std::move(resolveTask);
+ if (GrTextureResolveFlags::kMipMaps & flags) {
+ SkASSERT(GrMipMapped::kYes == textureProxyPtr->mipMapped());
+ SkASSERT(textureProxyPtr->mipMapsAreDirty());
+ textureProxyPtr->markMipMapsClean();
+ }
+
+ return resolveTask;
}
void GrTextureResolveRenderTask::gatherProxyIntervals(GrResourceAllocator* alloc) const {
@@ -62,17 +49,10 @@
}
bool GrTextureResolveRenderTask::onExecute(GrOpFlushState* flushState) {
- // Resolve msaa before regenerating mipmaps.
- if (GrTextureResolveFlags::kMSAA & fResolveFlags) {
- GrRenderTarget* renderTarget = fTarget->peekRenderTarget();
- SkASSERT(renderTarget);
- SkASSERT(renderTarget->needsResolve());
- flushState->gpu()->resolveRenderTarget(renderTarget);
- }
+ GrTexture* texture = fTarget->peekTexture();
+ SkASSERT(texture);
if (GrTextureResolveFlags::kMipMaps & fResolveFlags) {
- GrTexture* texture = fTarget->peekTexture();
- SkASSERT(texture);
SkASSERT(texture->texturePriv().mipMapsAreDirty());
flushState->gpu()->regenerateMipMapLevels(texture);
}