UgTextureArray
Layered texture array for batch rendering
It
GPU texture array with its image, memory, view, sampler, and descriptor set
struct It {
VkImage image;
VkDeviceMemory memory;
VkImageView view;
VkSampler sampler;
VkDescriptorSetLayout setLayout;
VkDescriptorSet descriptorSet;
U32 layerCount;
};create
Load multiple images as layers and upload them as a texture array
UgTextureArray.It create(UgContext.It& ctx, const I8** paths, U32 count);Parameters
ctx— Vulkan contextpaths— Array of file paths, one per layercount— Number of layers
Returns — Initialized texture array object
bind
Bind the texture array's descriptor set to a pipeline slot
U0 bind(UgTextureArray.It& arr, UgCommandBuffer.It& cmd, VkPipelineLayout pipelineLayout, U32 slot);Parameters
arr— Texture array to bindcmd— Active command bufferpipelineLayout— Pipeline layout the descriptor set is compatible withslot— Descriptor set index (texture slot)
destroy
Destroy the texture array and free all GPU resources
U0 destroy(UgContext.It& ctx, UgTextureArray.It& arr);Parameters
ctx— Vulkan contextarr— Texture array to destroy