Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage.
This change moves the color and resolve attachments used in a
GrVkRenderTarget to be a GrVkAttachment. These along with the msaa
attachment now mean that GrVkRenderTarget no longer needs to derive from
a GrVkImage.
There are a couple ugly things in this CL since GrVkTexture still is a
GrVkImage since we can't share attachments between GrVkRT and GrVkTex.
But when that gets updated in the follow on CL things will look much nicer.
Bug: skia:10727
Change-Id: I2f12674d7517c6d6dea389e2d1fb7296028bcc85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379576
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tests/BackendAllocationTest.cpp b/tests/BackendAllocationTest.cpp
index 577496d..7157989 100644
--- a/tests/BackendAllocationTest.cpp
+++ b/tests/BackendAllocationTest.cpp
@@ -78,7 +78,18 @@
ERRORF(reporter, "Couldn't make SkSurface from backendTexture for %s\n",
ToolUtils::colortype_name(skColorType));
} else {
- REPORTER_ASSERT(reporter, initialCount+1 == cache->getResourceCount());
+ // As we transition to using attachments instead of GrTextures and GrRenderTargets
+ // individual proxy instansiations may add multiple things to the cache. There would be
+ // an entry for the GrTexture/GrRenderTarget and entries for one or more attachments.
+ int cacheEntriesPerProxy = 1;
+ // We currently only have attachments on the vulkan backend
+ if (dContext->backend() == GrBackend::kVulkan) {
+ // If we ever make a rt with multisamples this would have an additional
+ // attachment as well.
+ cacheEntriesPerProxy++;
+ }
+ REPORTER_ASSERT(reporter,
+ initialCount + cacheEntriesPerProxy == cache->getResourceCount());
}
}