A quite common example of images used in 3D applications or games are CUBEMAPs, used for simulating an object reflecting its environment. For this purpose, we don't create a CUBEMAP image. We need to create a layered image and through image view, we tell the hardware that it should interpret its layers as six CUBEMAP faces.
Creating a layered 2D image with a CUBEMAP view
How to do it...
- Take a handle of a logical device. Store it in a variable of type VkDevice named logical_device.
- Choose the size of an image and remember it must be square. Save the image's dimensions in a variable of type uint32_t named size.
- Select the number of the image's mipmap levels. Initialize a variable of type uint32_t named num_mipmaps with the chosen number.
- Think about...