Update vulkan ranges to be 0 to 1 for all z values

The spec has been updated to require setting the range for z/depth values
to be 0-1 when the image is 2D instead of just ignoring the field as before.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4308

Change-Id: Ic054ee732472cd9c69f7197fd62cb0cb4f2b26ce
Reviewed-on: https://skia-review.googlesource.com/4308
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index f34c76c..f11193f 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -398,8 +398,6 @@
     resolveInfo.srcOffset = { srcVkRect.fLeft, srcVkRect.fTop, 0 };
     resolveInfo.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 };
     resolveInfo.dstOffset = { dstPoint.fX, dstY, 0 };
-    // By the spec the depth of the extent should be ignored for 2D images, but certain devices
-    // (e.g. nexus 5x) currently fail if it is not 1
     resolveInfo.extent = { (uint32_t)srcVkRect.width(), (uint32_t)srcVkRect.height(), 1 };
 
     dst->setImageLayout(this,
@@ -1411,9 +1409,6 @@
     copyRegion.srcOffset = { srcVkRect.fLeft, srcVkRect.fTop, 0 };
     copyRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 };
     copyRegion.dstOffset = { dstPoint.fX, dstY, 0 };
-    // The depth value of the extent is ignored according the vulkan spec for 2D images. However, on
-    // at least the nexus 5X it seems to be checking it. Thus as a working around we must have the
-    // depth value be 1.
     copyRegion.extent = { (uint32_t)srcVkRect.width(), (uint32_t)srcVkRect.height(), 1 };
 
     fCurrentCmdBuffer->copyImage(this,
@@ -1505,10 +1500,10 @@
     memset(&blitRegion, 0, sizeof(VkImageBlit));
     blitRegion.srcSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 };
     blitRegion.srcOffsets[0] = { srcVkRect.fLeft, srcVkRect.fTop, 0 };
-    blitRegion.srcOffsets[1] = { srcVkRect.fRight, srcVkRect.fBottom, 0 };
+    blitRegion.srcOffsets[1] = { srcVkRect.fRight, srcVkRect.fBottom, 1 };
     blitRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 };
     blitRegion.dstOffsets[0] = { dstRect.fLeft, dstRect.fTop, 0 };
-    blitRegion.dstOffsets[1] = { dstRect.fRight, dstRect.fBottom, 0 };
+    blitRegion.dstOffsets[1] = { dstRect.fRight, dstRect.fBottom, 1 };
 
     fCurrentCmdBuffer->blitImage(this,
                                  *srcImage,