Free and create descriptorSets gives error

This topic contains 1 reply, has 2 voices, and was last updated by  Bill Hollings 1 year, 8 months ago.

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


    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.


    Bill Hollings


    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,;

    add the following two lines:

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

    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.


Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘MoltenVK Support’ is closed to new topics and replies.