diff options
author | 2018-02-02 06:53:26 -0500 | |
---|---|---|
committer | 2018-02-02 12:19:52 +0000 | |
commit | 18c52a7b52211de5d0dcd86dc048adef758c6c75 (patch) | |
tree | 087aeca9b428687dc7e17578310db1f9621e59ea /src/gpu/vk/GrVkTextureRenderTarget.cpp | |
parent | 85ae7159c9c8a9186a4c7e74304eabb35bca9a79 (diff) |
Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""
This reverts commit d0d7270fcc32546005b8e847df516cb11592cd30.
Revert "More sample count cleanup:"
This reverts commit d653cac70ed17983125ceed053138c09f1401846.
Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types"
This reverts commit 85ae7159c9c8a9186a4c7e74304eabb35bca9a79.
Need to understand NVPR perf changes before relanding
Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b
Reviewed-on: https://skia-review.googlesource.com/102780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkTextureRenderTarget.cpp')
-rw-r--r-- | src/gpu/vk/GrVkTextureRenderTarget.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp index ee31f2364a..9a211e208a 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.cpp +++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp @@ -106,7 +106,7 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::Make(GrVkGpu* gpu, // create msaa surface if necessary GrVkImageInfo msInfo; const GrVkImageView* resolveAttachmentView = nullptr; - if (desc.fSampleCnt > 1) { + if (desc.fSampleCnt) { GrVkImage::ImageDesc msImageDesc; msImageDesc.fImageType = VK_IMAGE_TYPE_2D; msImageDesc.fFormat = pixelFormat; @@ -145,7 +145,7 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::Make(GrVkGpu* gpu, const GrVkImageView* colorAttachmentView = GrVkImageView::Create(gpu, colorImage, pixelFormat, GrVkImageView::kColor_Type, 1); if (!colorAttachmentView) { - if (desc.fSampleCnt > 1) { + if (desc.fSampleCnt) { resolveAttachmentView->unref(gpu); GrVkImage::DestroyImageInfo(gpu, &msInfo); } @@ -154,7 +154,7 @@ sk_sp<GrVkTextureRenderTarget> GrVkTextureRenderTarget::Make(GrVkGpu* gpu, } sk_sp<GrVkTextureRenderTarget> texRT; - if (desc.fSampleCnt > 1) { + if (desc.fSampleCnt) { if (!isWrapped) { texRT = sk_sp<GrVkTextureRenderTarget>(new GrVkTextureRenderTarget( gpu, budgeted, desc, @@ -232,7 +232,7 @@ GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(GrVkGpu* gpu, bool GrVkTextureRenderTarget::updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo& newInfo) { VkFormat pixelFormat; GrPixelConfigToVkFormat(this->config(), &pixelFormat); - if (this->numStencilSamples() > 1) { + if (this->numStencilSamples()) { const GrVkImageView* resolveAttachmentView = GrVkImageView::Create(gpu, newInfo.fImage, @@ -262,11 +262,8 @@ bool GrVkTextureRenderTarget::updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo& } size_t GrVkTextureRenderTarget::onGpuMemorySize() const { - int numColorSamples = this->numColorSamples(); - if (numColorSamples > 1) { - // Add one to account for the resolve VkImage. - ++numColorSamples; - } + // The plus 1 is to account for the resolve texture. + int numColorSamples = this->numColorSamples() + 1; return GrSurface::ComputeSize(this->config(), this->width(), this->height(), numColorSamples, // TODO: this still correct? this->texturePriv().mipMapped()); |