| 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 "vk/GrVkDefines.h" | 11 #include "vk/GrVkDefines.h" |
| 12 #include "vk/GrVkTypes.h" |
| 12 | 13 |
| 13 class GrVkGpu; | 14 class GrVkGpu; |
| 14 | 15 |
| 15 namespace GrVkMemory { | 16 namespace GrVkMemory { |
| 16 /** | 17 /** |
| 17 * Allocates vulkan device memory and binds it to the gpu's device for the gi
ven object. | 18 * Allocates vulkan device memory and binds it to the gpu's device for the gi
ven object. |
| 18 * Returns true of allocation succeeded. | 19 * Returns true of allocation succeeded. |
| 19 */ | 20 */ |
| 20 bool AllocAndBindBufferMemory(const GrVkGpu* gpu, | 21 bool AllocAndBindBufferMemory(const GrVkGpu* gpu, |
| 21 VkBuffer buffer, | 22 VkBuffer buffer, |
| 22 const VkMemoryPropertyFlags flags, | 23 const VkMemoryPropertyFlags flags, |
| 23 VkDeviceMemory* memory); | 24 GrVkAlloc* alloc); |
| 25 void FreeBufferMemory(const GrVkGpu* gpu, const GrVkAlloc& alloc); |
| 24 | 26 |
| 25 bool AllocAndBindImageMemory(const GrVkGpu* gpu, | 27 bool AllocAndBindImageMemory(const GrVkGpu* gpu, |
| 26 VkImage image, | 28 VkImage image, |
| 27 const VkMemoryPropertyFlags flags, | 29 const VkMemoryPropertyFlags flags, |
| 28 VkDeviceMemory* memory); | 30 GrVkAlloc* alloc); |
| 31 void FreeImageMemory(const GrVkGpu* gpu, const GrVkAlloc& alloc); |
| 29 | 32 |
| 30 VkPipelineStageFlags LayoutToPipelineStageFlags(const VkImageLayout layout); | 33 VkPipelineStageFlags LayoutToPipelineStageFlags(const VkImageLayout layout); |
| 31 | 34 |
| 32 VkAccessFlags LayoutToSrcAccessMask(const VkImageLayout layout); | 35 VkAccessFlags LayoutToSrcAccessMask(const VkImageLayout layout); |
| 33 } | 36 } |
| 34 | 37 |
| 35 #endif | 38 #endif |
| OLD | NEW |