#ifndef skgpu_VulkanMemory_DEFINED
#define skgpu_VulkanMemory_DEFINED
#include "include/gpu/vk/VulkanMemoryAllocator.h"
#include "include/private/gpu/vk/SkiaVulkan.h"
#include <functional>
namespace skgpu {
enum class Protected : bool;
struct VulkanAlloc;
namespace VulkanMemory {
CheckResult;
bool AllocBufferMemory(VulkanMemoryAllocator*,
VkBuffer buffer,
skgpu::Protected isProtected,
skgpu::VulkanMemoryAllocator::BufferUsage,
bool shouldPersistentlyMapCpuToGpu,
const std::function<CheckResult>&,
VulkanAlloc* alloc);
void FreeBufferMemory(VulkanMemoryAllocator*, const VulkanAlloc& alloc);
bool AllocImageMemory(VulkanMemoryAllocator*,
VkImage image,
skgpu::Protected isProtected,
bool forceDedicatedMemory,
bool useLazyAllocation,
const std::function<CheckResult>&,
VulkanAlloc* alloc);
void FreeImageMemory(VulkanMemoryAllocator*, const VulkanAlloc& alloc);
void* MapAlloc(VulkanMemoryAllocator*,
const VulkanAlloc&,
const std::function<CheckResult>&);
void UnmapAlloc(VulkanMemoryAllocator*, const VulkanAlloc& alloc);
void FlushMappedAlloc(VulkanMemoryAllocator*,
const skgpu::VulkanAlloc&,
VkDeviceSize offset,
VkDeviceSize size,
const std::function<CheckResult>&);
void InvalidateMappedAlloc(VulkanMemoryAllocator*,
const VulkanAlloc& alloc,
VkDeviceSize offset,
VkDeviceSize size,
const std::function<CheckResult>&);
void GetNonCoherentMappedMemoryRange(const VulkanAlloc&,
VkDeviceSize offset,
VkDeviceSize size,
VkDeviceSize alignment,
VkMappedMemoryRange*);
}
}
#endif