Class ImageAllocation

Inheritance Relationships

Base Type

Class Documentation

class ImageAllocation : public portal::renderer::vulkan::allocation::Allocated<vk::Image>

VMA-allocated Vulkan image with automatic memory management.

Inherits from Allocated<vk::Image>, providing VMA memory allocation/deallocation. Can also wrap pre-existing images (e.g., swapchain images) without ownership.

Destruction automatically calls vmaDestroyImage to free both image and backing memory (if VMA-allocated).

Public Functions

ImageAllocation()

Default constructor (creates null image)

ImageAllocation(std::nullptr_t)

Null constructor.

ImageAllocation(vk::Image image)

Wraps pre-existing image (no VMA allocation)

Parameters:

image – Pre-existing image handle (e.g., swapchain image)

ImageAllocation(ImageAllocation &&other) noexcept

Move constructor.

ImageAllocation &operator=(ImageAllocation &&other) noexcept

Move assignment.

virtual ImageAllocation &operator=(std::nullptr_t) noexcept override

Null assignment.

ImageAllocation(const ImageAllocation&) = delete
ImageAllocation &operator=(const ImageAllocation&) = delete
~ImageAllocation() override

Destructor (calls vmaDestroyImage if VMA-allocated)

Protected Functions

ImageAllocation(const VulkanDevice &device, const ImageBuilder &builder)

Friends

friend struct ImageBuilder