Represents a Vulkan texture with pixel data of a specified type. More...
Public Member Functions | |
| VulkanTexture (std::uint32_t width, std::uint32_t height, VkCommandBuffer cmd) | |
| Constructs a VulkanTexture with the given dimensions. | |
| VulkanTexture (const char *asset, VkCommandBuffer cmd) | |
| Constructs a VulkanTexture by loading from an in memory asset. | |
| void | Update (const PixelType *bufferdata, VkCommandBuffer cmd) |
| Updates the texture with new pixel data. | |
Public Attributes | |
| uint32_t | width |
| uint32_t | height |
Represents a Vulkan texture with pixel data of a specified type.
This class manages a Vulkan image resource along with its associated memory, buffer, and image view. It provides functionality to create textures either by specifying dimensions or loading from an asset, and to update the texture data on the GPU using command buffers.
| PixelType | The type of the pixel data stored in the texture. |
|
inline |
Constructs a VulkanTexture with the given dimensions.
Creates a Vulkan texture image with the specified width and height, initializing necessary resources.
| width | The width of the texture. |
| height | The height of the texture. |
| cmd | Vulkan command buffer used for resource initialization. |
|
inline |
Constructs a VulkanTexture by loading from an in memory asset.
Loads texture pixel data from the specified asset and initializes the Vulkan image resource accordingly.
| asset | Pointer to the in memory asset. |
| cmd | Vulkan command buffer used for resource initialization. |
|
inline |
Updates the texture with new pixel data.
Copies the given pixel data into the texture's buffer and issues Vulkan commands to upload the data to the GPU image.
| bufferdata | Pointer to the new pixel data. |
| cmd | Vulkan command buffer used for the update operation. |