7 assert(
m_bindings.contains(binding) == 0 &&
"Binding already exists in layout");
8 VkDescriptorSetLayoutBinding layoutBinding{};
9 layoutBinding.binding = binding;
10 layoutBinding.descriptorType = descriptorType;
11 layoutBinding.descriptorCount = count;
12 layoutBinding.stageFlags = stageFlags;
19 std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings{};
20 setLayoutBindings.reserve(bindings.size());
21 for (
auto [fst, snd] : bindings) {
22 setLayoutBindings.push_back(snd);
25 VkDescriptorSetLayoutCreateInfo descriptorSetLayoutInfo{};
26 descriptorSetLayoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
27 descriptorSetLayoutInfo.bindingCount =
static_cast<uint32_t
>(setLayoutBindings.size());
28 descriptorSetLayoutInfo.pBindings = setLayoutBindings.data();
30 if (vkCreateDescriptorSetLayout(
32 &descriptorSetLayoutInfo,
35 throw std::runtime_error(
"failed to create descriptor set layout!");