Images are rarely used directly in Vulkan commands. Framebuffers and shaders (via descriptor sets) access images through image views. Image views define a selected part of an image's memory and specify additional information needed to properly read an image's data. That's why we need to know how to create an image view.
Creating an image view
How to do it...
- Take the handle of a logical device and use it to initialize a variable of type VkDevice named logical_device.
- Use the handle of a created image to initialize a variable of type VkImage named image.
- Create a variable of type VkImageViewCreateInfo named image_view_create_info. Use the following values for its members:
- VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO value for sType
- nullptr value for pNext...