Free and create descriptorSets gives error


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1327
    kruseborn
    Participant

      I have created a descriptor pool with maxSet=15 and the flag VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT.

      Everytime I resize the window I delete one Texture and free the descriptorSet associated with it: vkFreeDescriptorSets(vkContext.device, vkContext.descriptorPool, 1, &texture.descriptorSet);

      I then create a new descriptorSet vkAllocateDescriptorSets with descriptorSetCount = 1. However after a few times I get the error: [***MoltenVK ERROR***] VK_ERROR_INITIALIZATION_FAILED: The maximum number of descriptor sets that can be allocated yb this descriptor pool is 15.

      I have checked the adress of the descriptor being freed and it is correct. I do not get any errors or warnings on Windows with the validation layer turned on.

      #1330
      Bill Hollings
      Keymaster

        @kruseborn

        Unfortunately, I am not able to replicate this issue here.

        Can you confirm behaviour with the MoltenVK demos, as follows, please?

        In the Hologram.cpp file within the MoltenVK Demos…after the line (557):

        vk::assert_success(vk::AllocateDescriptorSets(dev_, &set_info, desc_sets.data()));

        add the following two lines:

        vk::assert_success(vk::FreeDescriptorSets(dev_, desc_pool_, set_info.descriptorSetCount, desc_sets.data()));
        vk::assert_success(vk::AllocateDescriptorSets(dev_, &set_info, desc_sets.data()));

        Effectively…this is allocating the descriptor sets, then freeing them, then allocating them again. It works as expected.

        Removing the FreeDescriptorSets line causes the error that you are seeing to be returned…again as expected.

        Let me know if that helps you resolve your issue, or whether the it persists for some reason.

        …Bill

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The forum ‘MoltenVK Support’ is closed to new topics and replies.