Creating a pipeline layout with a combined image sampler, a buffer, and push constant ranges
We know how to create descriptor set layouts and use them to create a pipeline layout. Here, in this sample recipe, we will have a look at how to create a specific pipeline layout--one which allows a pipeline to access a combined image sampler, a uniform buffer, and a selected number of push constant ranges.
How to do it...
- Take the handle of a logical device and store it in a variable of type
VkDevice
namedlogical_device
. - Create a variable of type
std::vector<VkDescriptorSetLayoutBinding>
nameddescriptor_set_layout_bindings
. - Add a new element to the
descriptor_set_layout_bindings
vector and use the following values to initialize its members:0
value forbinding
.VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
value fordescriptorType
.1
value fordescriptorCount
.VK_SHADER_STAGE_FRAGMENT_BIT
value forstageFlags
.nullptr
value forpImmutableSamplers
.
- Add a second member to the
descriptor_set_layout_bindings
vector...