aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2016-11-02 11:57:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-02 16:30:59 +0000
commite76071ca0f98cb4d7e2d1789c46aa3037637b309 (patch)
treec71e4259d7af7e268fe93edc635cc6c15fe1574c /src/gpu/vk
parentdf707567a0bb59e9c8e9143cecf9a15fdd3200bb (diff)
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>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index f34c76cd92..f11193f245 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -398,8 +398,6 @@ void GrVkGpu::resolveImage(GrVkRenderTarget* dst, GrVkRenderTarget* src, const S
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 @@ void GrVkGpu::copySurfaceAsCopyImage(GrSurface* dst,
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 @@ void GrVkGpu::copySurfaceAsBlit(GrSurface* dst,
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,