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;
DescriptorPool leaks descriptor sets when the number of descriptor sets exceeds the
m_maxSetsPerPoolvalue. The reason is simple : inFreeDescriptorSetswe overridem_currentAllocationPoolIndexby the freed descriptor set pool index, but we don't test ifm_currentAllocationPoolIndexwas 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: