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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 if (linearTiling) { | 1049 if (linearTiling) { |
1050 const VkImageSubresource subres = { | 1050 const VkImageSubresource subres = { |
1051 VK_IMAGE_ASPECT_COLOR_BIT, | 1051 VK_IMAGE_ASPECT_COLOR_BIT, |
1052 0, // mipLevel | 1052 0, // mipLevel |
1053 0, // arraySlice | 1053 0, // arraySlice |
1054 }; | 1054 }; |
1055 VkSubresourceLayout layout; | 1055 VkSubresourceLayout layout; |
1056 | 1056 |
1057 VK_CALL(GetImageSubresourceLayout(fDevice, image, &subres, &layout))
; | 1057 VK_CALL(GetImageSubresourceLayout(fDevice, image, &subres, &layout))
; |
1058 | 1058 |
1059 if (!copy_testing_data(this, srcData, &alloc, rowCopyBytes, layout.r
owPitch, h)) { | 1059 if (!copy_testing_data(this, srcData, &alloc, rowCopyBytes, |
| 1060 static_cast<size_t>(layout.rowPitch), h)) { |
1060 GrVkMemory::FreeImageMemory(this, linearTiling, alloc); | 1061 GrVkMemory::FreeImageMemory(this, linearTiling, alloc); |
1061 VK_CALL(DestroyImage(fDevice, image, nullptr)); | 1062 VK_CALL(DestroyImage(fDevice, image, nullptr)); |
1062 return 0; | 1063 return 0; |
1063 } | 1064 } |
1064 } else { | 1065 } else { |
1065 SkASSERT(w && h); | 1066 SkASSERT(w && h); |
1066 | 1067 |
1067 VkBuffer buffer; | 1068 VkBuffer buffer; |
1068 VkBufferCreateInfo bufInfo; | 1069 VkBufferCreateInfo bufInfo; |
1069 memset(&bufInfo, 0, sizeof(VkBufferCreateInfo)); | 1070 memset(&bufInfo, 0, sizeof(VkBufferCreateInfo)); |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 } | 1773 } |
1773 | 1774 |
1774 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1775 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
1775 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1776 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
1776 // which is always at the first attachment. | 1777 // which is always at the first attachment. |
1777 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1778 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
1778 fCurrentCmdBuffer->executeCommands(this, buffer); | 1779 fCurrentCmdBuffer->executeCommands(this, buffer); |
1779 fCurrentCmdBuffer->endRenderPass(this); | 1780 fCurrentCmdBuffer->endRenderPass(this); |
1780 } | 1781 } |
1781 | 1782 |
OLD | NEW |