diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 280346fda1..28dce344be 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -1304,6 +1304,20 @@ bool GrVkGpu::onCopySurface(GrSurface* dst, return false; } +bool GrVkGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const { + // Currently we don't support msaa + if (src->asRenderTarget() && src->asRenderTarget()->numColorSamples() > 1) { + return false; + } + + // This will support copying the dst as CopyImage since all of our surfaces require transferSrc + // and transferDst usage flags in Vulkan. + desc->fOrigin = src->origin(); + desc->fConfig = src->config(); + desc->fFlags = kNone_GrSurfaceFlags; + return true; +} + void GrVkGpu::onGetMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings&, int* effectiveSampleCnt, SkAutoTDeleteArray*) { // TODO: stub. diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 91f9d4d379..5872f18671 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -75,9 +75,7 @@ public: int* effectiveSampleCnt, SkAutoTDeleteArray*); - bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override { - return false; - } + bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const override; void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {}