V-EZ icon indicating copy to clipboard operation
V-EZ copied to clipboard

DescriptorPool leaks when exceeding m_maxSetsPerPool

Open vlmillet opened this issue 4 years ago • 2 comments

DescriptorPool leaks descriptor sets when the number of descriptor sets exceeds the m_maxSetsPerPool value. The reason is simple : in FreeDescriptorSets we override m_currentAllocationPoolIndex by the freed descriptor set pool index, but we don't test if m_currentAllocationPoolIndex was already inferior to it which leads in loosing information of previously freed descriptor sets. There are two ways to fix this, but I think both must be used, just in case : The first is to use canonical destruction of descriptor sets by reversing order of destruction of transient resources in StreamEncoder. The second and safest is to add the above described test in DescriptorPool::FreeDescriptorSet :

if (poolIndex < m_currentAllocationPoolIndex)
    m_currentAllocationPoolIndex = poolIndex;

vlmillet avatar Feb 14 '20 13:02 vlmillet

🆙

vlmillet avatar Mar 23 '20 14:03 vlmillet

@vlmillet it's been a few years, but could you explain a bit more about what you mean when it comes to reversing the order of destruction in StreamEncoder? Do you still have the code change?

EvilTrev avatar May 08 '23 23:05 EvilTrev