brutal/Brutal.Vulkan.Abstractions/Allocator/IAllocator.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

28 lines
901 B
C#

namespace Brutal.VulkanApi.Abstractions;
/// <summary>
/// Base interface for a Vulkan allocator
/// </summary>
public interface IAllocator
{
/// <summary>
/// Get the Vulkan device this allocator is associated with
/// </summary>
/// <returns>Vulkan device handle</returns>
Device GetDevice();
VkAllocator? VkAllocator { get; }
/// <summary>
/// Safely maps memory (allocated by this allocator) to a pointer.
/// </summary>
/// <param name="allocationMapInfo">Allocation info for memory</param>
/// <returns>Pointer to mapped memory</returns>
Ptr MapMemory(in AllocationMapInfo allocationMapInfo);
/// <summary>
/// Safely unmaps memory (allocated by this allocator) from a pointer
/// </summary>
/// <param name="allocationMapInfo">Allocation info for memory</param>
void UnmapMemory(in AllocationMapInfo allocationMapInfo);
}