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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_HOST_BIT; | 272 VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_HOST_BIT; |
273 VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(
layout); | 273 VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(
layout); |
274 VkAccessFlags dstAccessMask = VK_ACCESS_HOST_WRITE_BIT; | 274 VkAccessFlags dstAccessMask = VK_ACCESS_HOST_WRITE_BIT; |
275 vkTex->setImageLayout(this, | 275 vkTex->setImageLayout(this, |
276 VK_IMAGE_LAYOUT_GENERAL, | 276 VK_IMAGE_LAYOUT_GENERAL, |
277 srcAccessMask, | 277 srcAccessMask, |
278 dstAccessMask, | 278 dstAccessMask, |
279 srcStageMask, | 279 srcStageMask, |
280 dstStageMask, | 280 dstStageMask, |
281 false); | 281 false); |
| 282 this->submitCommandBuffer(kForce_SyncQueue); |
282 } | 283 } |
283 success = this->uploadTexDataLinear(vkTex, left, top, width, height,
config, | 284 success = this->uploadTexDataLinear(vkTex, left, top, width, height,
config, |
284 texels.begin()->fPixels, texels.
begin()->fRowBytes); | 285 texels.begin()->fPixels, texels.
begin()->fRowBytes); |
285 } else { | 286 } else { |
286 int newMipLevels = texels.count(); | 287 int newMipLevels = texels.count(); |
287 int currentMipLevels = vkTex->texturePriv().maxMipMapLevel(); | 288 int currentMipLevels = vkTex->texturePriv().maxMipMapLevel(); |
288 if ((currentMipLevels || newMipLevels != 1) && newMipLevels != curre
ntMipLevels) { | 289 if ((currentMipLevels || newMipLevels != 1) && newMipLevels != curre
ntMipLevels) { |
289 if (!vkTex->reallocForMipmap(this, newMipLevels)) { | 290 if (!vkTex->reallocForMipmap(this, newMipLevels)) { |
290 return false; | 291 return false; |
291 } | 292 } |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 aglSwapBuffers(aglGetCurrentContext()); | 1808 aglSwapBuffers(aglGetCurrentContext()); |
1808 int set_a_break_pt_here = 9; | 1809 int set_a_break_pt_here = 9; |
1809 aglSwapBuffers(aglGetCurrentContext()); | 1810 aglSwapBuffers(aglGetCurrentContext()); |
1810 #elif defined(SK_BUILD_FOR_WIN32) | 1811 #elif defined(SK_BUILD_FOR_WIN32) |
1811 SwapBuf(); | 1812 SwapBuf(); |
1812 int set_a_break_pt_here = 9; | 1813 int set_a_break_pt_here = 9; |
1813 SwapBuf(); | 1814 SwapBuf(); |
1814 #endif | 1815 #endif |
1815 #endif | 1816 #endif |
1816 } | 1817 } |
OLD | NEW |