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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.