In this sample recipe, we will see how to create the most commonly used resources: a combined image sampler and a uniform buffer. We will prepare a descriptor set layout for them, create a descriptor pool, and allocate a descriptor set from it. Then we will update the allocated set with the created resources. This way, we can later bind the descriptor set to a command buffer and access resources in shaders.
Creating descriptors with a texture and a uniform buffer
How to do it...
- Create a combined image sampler (an image, image view, and a sampler) with the selected parameters--the most commonly used are VK_IMAGE_TYPE_2D image type, VK_FORMAT_R8G8B8A8_UNORM format, VK_IMAGE_VIEW_TYPE_2D view type, VK_IMAGE_ASPECT_COLOR_BIT aspect, VK_FILTER_LINEAR filter mode, and...