Implementing the image resource with optimal tiling

Optimal tiling is implemented through the staging buffer. First, a buffer resource object is created and stored with the raw image data contents. Next, the buffer resource data contents are copied to a newly created image object using the buffer-to-image copy command. The buffer-to-image copy command (vkCmdCopyBufferToImage) copies the buffer memory contents to the image memory.

In this section, we will implement the image resources using optimal tiling. In order to create an image resource with optimal tiling our user defined function VulkanRenderer::createTextureOptimal() can be used. This function takes parameters in the same way as the createTextureLinear() function:

void VulkanRenderer::createTextureOptimal(const ...

Get Learning Vulkan now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.