V-EZ
V-EZ copied to clipboard
DescriptorPool leaks when exceeding m_maxSetsPerPool
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 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?