| 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 #ifndef GrVkMemory_DEFINED | 8 #ifndef GrVkMemory_DEFINED |
| 9 #define GrVkMemory_DEFINED | 9 #define GrVkMemory_DEFINED |
| 10 | 10 |
| 11 #include "GrVkBuffer.h" | 11 #include "GrVkBuffer.h" |
| 12 #include "SkTArray.h" | 12 #include "SkTArray.h" |
| 13 #include "SkTLList.h" | 13 #include "SkTLList.h" |
| 14 #include "vk/GrVkDefines.h" | 14 #include "vk/GrVkDefines.h" |
| 15 #include "vk/GrVkTypes.h" | 15 #include "vk/GrVkTypes.h" |
| 16 | 16 |
| 17 class GrVkGpu; | 17 class GrVkGpu; |
| 18 | 18 |
| 19 namespace GrVkMemory { | 19 namespace GrVkMemory { |
| 20 /** | 20 /** |
| 21 * Allocates vulkan device memory and binds it to the gpu's device for the gi
ven object. | 21 * Allocates vulkan device memory and binds it to the gpu's device for the gi
ven object. |
| 22 * Returns true if allocation succeeded. | 22 * Returns true if allocation succeeded. |
| 23 */ | 23 */ |
| 24 bool AllocAndBindBufferMemory(const GrVkGpu* gpu, | 24 bool AllocAndBindBufferMemory(const GrVkGpu* gpu, |
| 25 VkBuffer buffer, | 25 VkBuffer buffer, |
| 26 GrVkBuffer::Type type, | 26 GrVkBuffer::Type type, |
| 27 bool dynamic, |
| 27 GrVkAlloc* alloc); | 28 GrVkAlloc* alloc); |
| 28 void FreeBufferMemory(const GrVkGpu* gpu, GrVkBuffer::Type type, const GrVkA
lloc& alloc); | 29 void FreeBufferMemory(const GrVkGpu* gpu, GrVkBuffer::Type type, const GrVkA
lloc& alloc); |
| 29 | 30 |
| 30 bool AllocAndBindImageMemory(const GrVkGpu* gpu, | 31 bool AllocAndBindImageMemory(const GrVkGpu* gpu, |
| 31 VkImage image, | 32 VkImage image, |
| 32 bool linearTiling, | 33 bool linearTiling, |
| 33 GrVkAlloc* alloc); | 34 GrVkAlloc* alloc); |
| 34 void FreeImageMemory(const GrVkGpu* gpu, bool linearTiling, const GrVkAlloc&
alloc); | 35 void FreeImageMemory(const GrVkGpu* gpu, bool linearTiling, const GrVkAlloc&
alloc); |
| 35 | 36 |
| 36 VkPipelineStageFlags LayoutToPipelineStageFlags(const VkImageLayout layout); | 37 VkPipelineStageFlags LayoutToPipelineStageFlags(const VkImageLayout layout); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 uint32_t memoryTypeIndex, GrVkAlloc* alloc); | 116 uint32_t memoryTypeIndex, GrVkAlloc* alloc); |
| 116 | 117 |
| 117 const GrVkGpu* fGpu; | 118 const GrVkGpu* fGpu; |
| 118 VkDeviceSize fSubHeapSize; | 119 VkDeviceSize fSubHeapSize; |
| 119 VkDeviceSize fAllocSize; | 120 VkDeviceSize fAllocSize; |
| 120 VkDeviceSize fUsedSize; | 121 VkDeviceSize fUsedSize; |
| 121 AllocFunc fAllocFunc; | 122 AllocFunc fAllocFunc; |
| 122 SkTArray<SkAutoTDelete<GrVkSubHeap>> fSubHeaps; | 123 SkTArray<SkAutoTDelete<GrVkSubHeap>> fSubHeaps; |
| 123 }; | 124 }; |
| 124 #endif | 125 #endif |
| OLD | NEW |