70 uint32_t height, VkFormat format, VkImageTiling tiling,
71 VkImageUsageFlags usage, VkMemoryPropertyFlags properties,
72 VkImage* image, VkDeviceMemory* imageMemory,
73 VkSampleCountFlagBits numSamples);
93 VkImageLayout newLayout, VkCommandPool commandPool,
108 uint32_t height, VkCommandPool commandPool,
181 void* data,
size_t texWidth,
size_t texHeight,
182 VkDeviceSize imageSize, VkFormat format, std::string
textureName);
202 VkDescriptorSet descriptorSet;
203 VkSampler textureSampler;
This initializes, manages and destroys the logical and physical devices(GPU).
This class holds the Vulkan data and objects needed for a texture.
std::string textureName
The name of the texture.
VkDeviceMemory textureImageMemory
The memory for the texture.
Chronos::Engine::Device device
The device that has the texture.
VkImageView textureImageView
The image view for the texture.
VkImage textureImage
The image for the texture.
void destroy()
Destroy the texture assets.
void create(Chronos::Engine::Device device, VkCommandPool commandPool, std::string texturePath, std::string textureName)
Create the texture by loading the texture from the given path. Only supports jpg and png images.
std::string texturePath
The path of the texture that it was loaded from.
Contains the Device class.
void createTextureSampler(Chronos::Engine::Device device, VkSampler *textureSampler)
Creates a VkSampler
VkImageView createImageView(Chronos::Engine::Device device, VkFormat format, VkImage image)
Create a VkImageView for a given VkImage.
void createImage(Chronos::Engine::Device device, uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage *image, VkDeviceMemory *imageMemory, VkSampleCountFlagBits numSamples)
For a given image dimensons, it creates a VkImage and.
void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height, VkCommandPool commandPool, Chronos::Engine::Device device)
Copy data from a buffer to an image.
void transitionImageLayout(VkImage image, VkImageLayout oldLayout, VkImageLayout newLayout, VkCommandPool commandPool, Chronos::Engine::Device device)
Transiton a VkImage from one layout to another.