From e9906e71fbc29968ea10680f0fcd53a4153c7568 Mon Sep 17 00:00:00 2001 From: brianosman Date: Wed, 8 Jun 2016 12:44:27 -0700 Subject: Fix mipmap generation on Nexus 5x & 6p devices. Just like copyImage, these want the Z range of blit regions to be [0, 1], even for 2D resources where Z should be ignored. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2039913007 Review-Url: https://codereview.chromium.org/2039913007 --- src/gpu/vk/GrVkGpu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index d18481c08a..bc0b98ea8b 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -734,10 +734,10 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) const { memset(&blitRegion, 0, sizeof(VkImageBlit)); blitRegion.srcSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; blitRegion.srcOffsets[0] = { 0, 0, 0 }; - blitRegion.srcOffsets[1] = { width, height, 0 }; + blitRegion.srcOffsets[1] = { width, height, 1 }; blitRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; blitRegion.dstOffsets[0] = { 0, 0, 0 }; - blitRegion.dstOffsets[1] = { width, height, 0 }; + blitRegion.dstOffsets[1] = { width, height, 1 }; fCurrentCmdBuffer->blitImage(this, oldResource, @@ -780,10 +780,10 @@ void GrVkGpu::generateMipmap(GrVkTexture* tex) const { blitRegion.srcSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, mipLevel - 1, 0, 1 }; blitRegion.srcOffsets[0] = { 0, 0, 0 }; - blitRegion.srcOffsets[1] = { prevWidth, prevHeight, 0 }; + blitRegion.srcOffsets[1] = { prevWidth, prevHeight, 1 }; blitRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, mipLevel, 0, 1 }; blitRegion.dstOffsets[0] = { 0, 0, 0 }; - blitRegion.dstOffsets[1] = { width, height, 0 }; + blitRegion.dstOffsets[1] = { width, height, 1 }; fCurrentCmdBuffer->blitImage(this, *tex, *tex, -- cgit v1.2.3