| 678 | } |
| 679 | |
| 680 | VkResult IBLLib::vkHelper::createDescriptorSet(VkDescriptorSet& _outDescriptorSet, VkDescriptorSetLayout _layout) const |
| 681 | { |
| 682 | if (m_logicalDevice == VK_NULL_HANDLE || m_descriptorPool == VK_NULL_HANDLE) |
| 683 | { |
| 684 | return VK_RESULT_MAX_ENUM; |
| 685 | } |
| 686 | |
| 687 | VkResult res = VK_SUCCESS; |
| 688 | |
| 689 | VkDescriptorSetAllocateInfo info{}; |
| 690 | info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; |
| 691 | info.pNext = nullptr; |
| 692 | info.pSetLayouts = &_layout; |
| 693 | info.descriptorSetCount = 1u; |
| 694 | info.descriptorPool = m_descriptorPool; |
| 695 | |
| 696 | if ((res = vkAllocateDescriptorSets(m_logicalDevice, &info, &_outDescriptorSet)) != VK_SUCCESS) |
| 697 | { |
| 698 | printf("Failed to allocate descriptor set [%u]\n", res); |
| 699 | } |
| 700 | |
| 701 | return res; |
| 702 | } |
| 703 | |
| 704 | VkResult IBLLib::vkHelper::createDescriptorSets(std::vector<VkDescriptorSet>& _outDescriptorSets, const std::vector<VkDescriptorSetLayout>& _layouts) const |
| 705 | { |