diff options
author | brianosman <brianosman@google.com> | 2016-06-08 12:44:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-08 12:44:28 -0700 |
commit | e9906e71fbc29968ea10680f0fcd53a4153c7568 (patch) | |
tree | 68ff5f79a3d9d6ba69ef4c0edc46873aec84a668 | |
parent | 2a437e64593ab597cf66d48b91cab0ab2ed76382 (diff) |
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
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 8 |
1 files 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, |