1 /* 2 * Copyright 2024 Google LLC. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef skgpu_VulkanMemoryAllocatorUtil_DEFINED 9 #define skgpu_VulkanMemoryAllocatorUtil_DEFINED 10 11 #include "include/core/SkRefCnt.h" 12 #include "include/gpu/GpuTypes.h" 13 #include "include/private/base/SkAPI.h" 14 #include "include/private/gpu/vk/SkiaVulkan.h" 15 16 #include <optional> 17 18 namespace skgpu { 19 20 struct VulkanBackendContext; 21 class VulkanExtensions; 22 class VulkanMemoryAllocator; 23 enum class ThreadSafe : bool; 24 25 namespace VulkanMemoryAllocators { 26 // Returns a concrete implementation of a memory allocator. Because this has settings 27 // which are done at compile time, we cannot really expose this to clients in a meaningful way. 28 sk_sp<VulkanMemoryAllocator> Make(const skgpu::VulkanBackendContext&, 29 ThreadSafe, 30 std::optional<VkDeviceSize> blockSize); 31 32 } // namespace VulkanMemoryAllocators 33 } // namespace skgpu 34 35 #endif // skgpu_VulkanMemoryAllocatorUtil_DEFINED 36