From e79b473714866682dea85b66c005c5bb2ff6a397 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 20 Apr 2017 14:07:46 -0400 Subject: Disable use of directly wrapping msaa RTs on Vulkan Currently the Vulkan backend is set up to always treat the "resolve" target as the main VkImage in a render target and the msaa is a side cart image. This makes it difficult to just wrap an msaa image that we don't own. However, unlike GL the equivalent FBO 0 will never be multisampled so there isn't much use for the functionality. Once we find a need for it we can find a way to refactor to make it work. Bug: skia: Change-Id: I121e9c72a70c2a6f1aaddba2dbae19d8bddc3998 Reviewed-on: https://skia-review.googlesource.com/13980 Reviewed-by: Brian Osman Commit-Queue: Greg Daniel --- src/gpu/vk/GrVkGpu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gpu/vk') diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 12d98769cf..3d30e3585b 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -822,6 +822,13 @@ sk_sp GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTe } sk_sp GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc){ + // Currently the Vulkan backend does not support wrapping of msaa render targets directly. In + // general this is not an issue since swapchain images in vulkan are never multisampled. Thus if + // you want a multisampled RT it is best to wrap the swapchain images and then let Skia handle + // creating and owning the MSAA images. + if (wrapDesc.fSampleCnt) { + return nullptr; + } const GrVkImageInfo* info = reinterpret_cast(wrapDesc.fRenderTargetHandle); @@ -834,7 +841,7 @@ sk_sp GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTa desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; desc.fWidth = wrapDesc.fWidth; desc.fHeight = wrapDesc.fHeight; - desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()); + desc.fSampleCnt = 0; desc.fOrigin = resolve_origin(wrapDesc.fOrigin); -- cgit v1.2.3