C Specification

To free allocated descriptor sets, call:

// Provided by VK_VERSION_1_0
VkResult vkFreeDescriptorSets(
    VkDevice                                    device,
    VkDescriptorPool                            descriptorPool,
    uint32_t                                    descriptorSetCount,
    const VkDescriptorSet*                      pDescriptorSets);

Parameters

  • device is the logical device that owns the descriptor pool.

  • descriptorPool is the descriptor pool from which the descriptor sets were allocated.

  • descriptorSetCount is the number of elements in the pDescriptorSets array.

  • pDescriptorSets is a pointer to an array of handles to VkDescriptorSet objects.

Description

After calling vkFreeDescriptorSets, all descriptor sets in pDescriptorSets are invalid.

If recycleDescriptorSetMemory is VK_FALSE, then freeing a descriptor set does not make the pool memory it used available to be reallocated until the descriptor pool is reset. If recycleDescriptorSetMemory is VK_TRUE, then the memory is available to be reallocated immediately after freeing the descriptor set.

Valid Usage
  • VUID-vkFreeDescriptorSets-pDescriptorSets-00309
    All submitted commands that refer to any element of pDescriptorSets must have completed execution

  • VUID-vkFreeDescriptorSets-pDescriptorSets-00310
    pDescriptorSets must be a valid pointer to an array of descriptorSetCount VkDescriptorSet handles, each element of which must either be a valid handle or VK_NULL_HANDLE

  • VUID-vkFreeDescriptorSets-descriptorPool-00312
    descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag

Valid Usage (Implicit)
  • VUID-vkFreeDescriptorSets-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkFreeDescriptorSets-descriptorPool-parameter
    descriptorPool must be a valid VkDescriptorPool handle

  • VUID-vkFreeDescriptorSets-descriptorSetCount-arraylength
    descriptorSetCount must be greater than 0

  • VUID-vkFreeDescriptorSets-descriptorPool-parent
    descriptorPool must have been created, allocated, or retrieved from device

  • VUID-vkFreeDescriptorSets-pDescriptorSets-parent
    Each element of pDescriptorSets that is a valid handle must have been created, allocated, or retrieved from descriptorPool

Host Synchronization
  • Host access to descriptorPool must be externally synchronized

  • Host access to each member of pDescriptorSets must be externally synchronized

Return Codes
On success, this command returns
  • VK_SUCCESS

See Also

Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0