Fix descriptor pool fragmentation (#2949)

This commit is contained in:
Adrian Cojocaru
2024-10-22 18:45:02 +03:00
committed by GitHub
parent c098a12c37
commit 7ff0c71312
6 changed files with 160 additions and 92 deletions

View File

@@ -201,7 +201,7 @@ void Texture2D::uploadSubRegion(const void* pixelData,
enqueueCommands(commandBuffer);
context.enqueueDeletion([buffAlloc = std::move(bufferAllocation)](const auto&) mutable { buffAlloc.reset(); });
context.enqueueDeletion([buffAlloc = std::move(bufferAllocation)](auto&) mutable { buffAlloc.reset(); });
context.renderingStats().numTextureUpdates++;
}
@@ -391,7 +391,7 @@ void Texture2D::createSampler() {
void Texture2D::destroyTexture() {
if (imageAllocation) {
context.enqueueDeletion([allocation = std::move(imageAllocation)](const auto&) mutable { allocation.reset(); });
context.enqueueDeletion([allocation = std::move(imageAllocation)](auto&) mutable { allocation.reset(); });
imageLayout = vk::ImageLayout::eUndefined;
}
@@ -399,7 +399,7 @@ void Texture2D::destroyTexture() {
void Texture2D::destroySampler() {
if (sampler) {
context.enqueueDeletion([sampler_ = std::move(sampler)](const auto& context_) mutable {
context.enqueueDeletion([sampler_ = std::move(sampler)](auto& context_) mutable {
context_.getBackend().getDevice()->destroySampler(sampler_);
});