Skip to content

Commit

Permalink
set flag to allow manually freeing descriptor sets
Browse files Browse the repository at this point in the history
  • Loading branch information
WinteryFox committed Nov 22, 2023
1 parent ad17251 commit ddb7813
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/engine/vk/VkDescriptorPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Vixen::Vk {
const VkDescriptorPoolCreateInfo info{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = 0,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.maxSets = maxSets,
.poolSizeCount = static_cast<uint32_t>(sizes.size()),
.pPoolSizes = sizes.data()
Expand Down
5 changes: 4 additions & 1 deletion src/engine/vk/VkDescriptorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ namespace Vixen::Vk {
}

VkDescriptorSet::~VkDescriptorSet() {
vkFreeDescriptorSets(device->getDevice(), pool->getPool(), 1, &set);
checkVulkanResult(
vkFreeDescriptorSets(device->getDevice(), pool->getPool(), 1, &set),
"Failed to free descriptor set"
);
}

void VkDescriptorSet::updateUniformBuffer(const uint32_t binding, const VkBuffer& buffer) const {
Expand Down

0 comments on commit ddb7813

Please sign in to comment.