#pragma once #include #include "vk_mem_alloc.h" class Instance; class Image { public: Image(uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage); Image(void *initialData, VkDeviceSize size, uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage); ~Image(); VkImageView createView(VkImageAspectFlags aspectFlags); VkSampler createSampler(); VkImage handle = VK_NULL_HANDLE; VkImageView view = VK_NULL_HANDLE; VkSampler sampler = VK_NULL_HANDLE; uint32_t width; uint32_t height; private: VkFormat format; void transitionLayout(VkImageLayout oldLayout, VkImageLayout newLayout); VmaAllocation allocation = nullptr; VmaAllocationInfo allocationInfo {}; };