You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
781 B

#pragma once
#include <vulkan/vulkan.h>
#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 {};
};