vpr::Image class

} Wraps the common image creation, transfer, and staging methods. Texture derives from this, and so does DepthStencil. Also provides static functions to initialize a passed VkImage handle and Allocation object.

Public static functions

static auto GetMemoryBarrier(const VkImage& image, const VkFormat& img_format, const VkImageLayout& prev, const VkImageLayout& next) -> VkImageMemoryBarrier
Returns an appropriate memory barrier for the given image, to transfer it between image layouts.
static void CreateImage(VkImage& dest_image, Allocation& dest_alloc, const Device* parent, const VkImageCreateInfo& create_info, const VkMemoryPropertyFlags& memory_flags)
Simplified version of the other CreateImage method, that takes an already setup VkImageCreateInfo struct instead of creating one from the given parameters.

Public functions

void TransitionLayout(const VkImageLayout& initial, const VkImageLayout& final, CommandPool* cmd, VkQueue& queue)
Uses a memory barrier to enforce an image layout change.

Function documentation

void vpr::Image::TransitionLayout(const VkImageLayout& initial, const VkImageLayout& final, CommandPool* cmd, VkQueue& queue)

Uses a memory barrier to enforce an image layout change.

Useful for preparing various images for use before rendering.