Fix resolve assert in vulkan
Bug: skia:
Change-Id: I4fbf067112901a86faa7df301d3442281f563bcb
Reviewed-on: https://skia-review.googlesource.com/13767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index a483ccb..71a8668 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -412,7 +412,6 @@
GrRenderTarget* dstRT = dst->asRenderTarget();
if (dstRT) {
GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(dstRT);
- SkASSERT(vkRT->numColorSamples() <= 1);
dstImage = vkRT;
} else {
SkASSERT(dst->asTexture());
@@ -1583,8 +1582,10 @@
return false;
}
- // The dst must not be a multisampled render target
- if (dst->asRenderTarget() && dst->asRenderTarget()->numColorSamples() > 1) {
+ // The dst must not be a multisampled render target, expect in the case where the dst is the
+ // resolve texture connected to the msaa src. We check for this in case we are copying a part of
+ // a surface to a different region in the same surface.
+ if (dst->asRenderTarget() && dst->asRenderTarget()->numColorSamples() > 1 && dst != src) {
return false;
}