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 "GrVkMemory.h" | 8 #include "GrVkMemory.h" |
9 | 9 |
10 #include "GrVkGpu.h" | 10 #include "GrVkGpu.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // and the image is linear. | 218 // and the image is linear. |
219 // TODO: Add check for linear here so we are not always adding host to gener
al, and we should | 219 // TODO: Add check for linear here so we are not always adding host to gener
al, and we should |
220 // only be in preinitialized if we are linear | 220 // only be in preinitialized if we are linear |
221 VkAccessFlags flags = 0;; | 221 VkAccessFlags flags = 0;; |
222 if (VK_IMAGE_LAYOUT_GENERAL == layout) { | 222 if (VK_IMAGE_LAYOUT_GENERAL == layout) { |
223 flags = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | | 223 flags = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | |
224 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | | 224 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | |
225 VK_ACCESS_TRANSFER_WRITE_BIT | | 225 VK_ACCESS_TRANSFER_WRITE_BIT | |
226 VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_HOST_READ_BIT; | 226 VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_HOST_READ_BIT; |
227 } else if (VK_IMAGE_LAYOUT_PREINITIALIZED == layout) { | 227 } else if (VK_IMAGE_LAYOUT_PREINITIALIZED == layout) { |
228 flags = VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_HOST_READ_BIT; | 228 flags = VK_ACCESS_HOST_WRITE_BIT; |
229 } else if (VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL == layout) { | 229 } else if (VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL == layout) { |
230 flags = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; | 230 flags = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; |
231 } else if (VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL == layout) { | 231 } else if (VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL == layout) { |
232 flags = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; | 232 flags = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; |
233 } else if (VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL == layout) { | 233 } else if (VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL == layout) { |
234 flags = VK_ACCESS_TRANSFER_WRITE_BIT; | 234 flags = VK_ACCESS_TRANSFER_WRITE_BIT; |
235 } else if (VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL == layout) { | 235 } else if (VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL == layout) { |
236 flags = VK_ACCESS_TRANSFER_READ_BIT; | 236 flags = VK_ACCESS_TRANSFER_READ_BIT; |
237 } else if (VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL == layout) { | 237 } else if (VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL == layout) { |
238 flags = VK_ACCESS_SHADER_READ_BIT; | 238 flags = VK_ACCESS_SHADER_READ_BIT; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 fSubHeaps[i]->free(alloc); | 556 fSubHeaps[i]->free(alloc); |
557 fUsedSize -= alloc.fSize; | 557 fUsedSize -= alloc.fSize; |
558 return true; | 558 return true; |
559 } | 559 } |
560 } | 560 } |
561 | 561 |
562 return false; | 562 return false; |
563 } | 563 } |
564 | 564 |
565 | 565 |
OLD | NEW |