diff options
author | Greg Daniel <egdaniel@google.com> | 2017-04-20 14:07:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-20 20:49:51 +0000 |
commit | e79b473714866682dea85b66c005c5bb2ff6a397 (patch) | |
tree | 0ca1dfe8f194c8fe3b463ba01dc3171db0690cdc /src/gpu/vk | |
parent | eccf352a2843bd5c732abfd6cc8a8449cde97a26 (diff) |
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 <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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<GrTexture> GrVkGpu::onWrapBackendTexture(const GrBackendTexture& backendTe } sk_sp<GrRenderTarget> 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<const GrVkImageInfo*>(wrapDesc.fRenderTargetHandle); @@ -834,7 +841,7 @@ sk_sp<GrRenderTarget> 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); |