From e76071ca0f98cb4d7e2d1789c46aa3037637b309 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Wed, 2 Nov 2016 11:57:06 -0400 Subject: 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 Reviewed-by: Jim Van Verth --- src/gpu/vk/GrVkGpu.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/gpu') 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, -- cgit v1.2.3