Commit d9c82562 by Alexis Hetu Committed by Alexis Hétu

DescriptorSetLayout destruction fix

Extra useless deallocations weren't cleaned up properly. Removed them. Bug b/123244275 Change-Id: I418a4c09a870748551a92c1abb3986e94b32ba92 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27289Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent e56c0d01
...@@ -75,17 +75,7 @@ DescriptorSetLayout::DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo* ...@@ -75,17 +75,7 @@ DescriptorSetLayout::DescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo*
void DescriptorSetLayout::destroy(const VkAllocationCallbacks* pAllocator) void DescriptorSetLayout::destroy(const VkAllocationCallbacks* pAllocator)
{ {
for(uint32_t i = 0; i < bindingCount; i++) vk::deallocate(bindings, pAllocator); // This allocation also contains pImmutableSamplers
{
if(UsesImmutableSamplers(bindings[i]))
{
// A single allocation is used for all immutable samplers, so only a single deallocation is needed.
vk::deallocate(const_cast<VkSampler*>(bindings[i].pImmutableSamplers), pAllocator);
break;
}
}
vk::deallocate(bindings, pAllocator);
} }
size_t DescriptorSetLayout::ComputeRequiredAllocationSize(const VkDescriptorSetLayoutCreateInfo* pCreateInfo) size_t DescriptorSetLayout::ComputeRequiredAllocationSize(const VkDescriptorSetLayoutCreateInfo* pCreateInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment