namespace Brutal.VulkanApi.Abstractions;
///
/// Struct containing information about an image allocation
///
public struct ImageAllocationInfo
{
///
/// Image handle
///
public VkImage Image;
///
/// Size of image
///
public VkExtent3D Extent;
///
/// Format of image, for reference
///
public VkFormat Format;
///
/// Number of mip levels
///
public int MipLevels;
///
/// Number of array layers allocated
///
public int ArrayLayers;
///
/// Memory allocation info
///
public AllocationInfo MemAllocationInfo;
///
/// Allocator-specific handle
///
public nint AllocHandle => MemAllocationInfo.AllocHandle;
///
/// Allocator that sourced this image
///
public IImageAllocator Allocator => (IImageAllocator)MemAllocationInfo.Allocator;
}
///
/// Interface for an image allocator object capable of allocating and freeing images
///
public interface IImageAllocator : IAllocator
{
///
/// Allocate an image with the given creation and allocation info.
///
/// Debug name of allocation
/// Vulkan image creation info
/// Memory allocation info
/// Struct containing all relevant information about the allocation
public ImageAllocationInfo AllocateImage(
in string name,
in VkImageCreateInfo imageCreateInfo,
in AllocationInfo.CreateInfo allocateCreateInfo
);
///
/// Free an image allocation
///
/// Struct containing all relevant information about the allocation
public void FreeAllocation(in ImageAllocationInfo inAllocation);
}