The most common image type that is used in many popular applications or games is typical 2D textures with four RGBA components and 32 bits per texel. To create such a resource in Vulkan, we need to create a 2D image and a proper image view.
Creating a 2D image and view
How to do it...
- Take a handle of a logical device and use it to initialize a variable of type VkDevice named logical_device.
- Select the data format used in the image and initialize a variable of type VkFormat named format with the selected value.
- Choose the size of the image. Store it in a variable of type VkExtent2D named size.
- Choose the number of mipmap levels that should compose the image. Initialize a variable of type uint32_t named num_mipmaps with the selected number of mipmaps.
- Specify the...