| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
| 9 | 9 |
| 10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 srcVkRect.fBottom = src->height() - srcRect.fTop; | 1255 srcVkRect.fBottom = src->height() - srcRect.fTop; |
| 1256 dstY = dst->height() - dstPoint.fY - srcVkRect.height(); | 1256 dstY = dst->height() - dstPoint.fY - srcVkRect.height(); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 VkImageCopy copyRegion; | 1259 VkImageCopy copyRegion; |
| 1260 memset(©Region, 0, sizeof(VkImageCopy)); | 1260 memset(©Region, 0, sizeof(VkImageCopy)); |
| 1261 copyRegion.srcSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; | 1261 copyRegion.srcSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; |
| 1262 copyRegion.srcOffset = { srcVkRect.fLeft, srcVkRect.fTop, 0 }; | 1262 copyRegion.srcOffset = { srcVkRect.fLeft, srcVkRect.fTop, 0 }; |
| 1263 copyRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; | 1263 copyRegion.dstSubresource = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 }; |
| 1264 copyRegion.dstOffset = { dstPoint.fX, dstY, 0 }; | 1264 copyRegion.dstOffset = { dstPoint.fX, dstY, 0 }; |
| 1265 copyRegion.extent = { (uint32_t)srcVkRect.width(), (uint32_t)srcVkRect.heigh
t(), 0 }; | 1265 // The depth value of the extent is ignored according the vulkan spec for 2D
images. However, on |
| 1266 // at least the nexus 5X it seems to be checking it. Thus as a working aroun
d we must have the |
| 1267 // depth value be 1. |
| 1268 copyRegion.extent = { (uint32_t)srcVkRect.width(), (uint32_t)srcVkRect.heigh
t(), 1 }; |
| 1266 | 1269 |
| 1267 fCurrentCmdBuffer->copyImage(this, | 1270 fCurrentCmdBuffer->copyImage(this, |
| 1268 srcImage, | 1271 srcImage, |
| 1269 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, | 1272 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, |
| 1270 dstImage, | 1273 dstImage, |
| 1271 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, | 1274 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, |
| 1272 1, | 1275 1, |
| 1273 ©Region); | 1276 ©Region); |
| 1274 } | 1277 } |
| 1275 | 1278 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 aglSwapBuffers(aglGetCurrentContext()); | 1704 aglSwapBuffers(aglGetCurrentContext()); |
| 1702 int set_a_break_pt_here = 9; | 1705 int set_a_break_pt_here = 9; |
| 1703 aglSwapBuffers(aglGetCurrentContext()); | 1706 aglSwapBuffers(aglGetCurrentContext()); |
| 1704 #elif defined(SK_BUILD_FOR_WIN32) | 1707 #elif defined(SK_BUILD_FOR_WIN32) |
| 1705 SwapBuf(); | 1708 SwapBuf(); |
| 1706 int set_a_break_pt_here = 9; | 1709 int set_a_break_pt_here = 9; |
| 1707 SwapBuf(); | 1710 SwapBuf(); |
| 1708 #endif | 1711 #endif |
| 1709 #endif | 1712 #endif |
| 1710 } | 1713 } |
| OLD | NEW |