private void RecycleCommandListResources(CompiledCommandList commandList, long fenceValue) { // Set fence on staging textures foreach (var stagingResource in commandList.StagingResources) { stagingResource.StagingFenceValue = fenceValue; } StagingResourceLists.Release(commandList.StagingResources); commandList.StagingResources.Clear(); // Recycle all resources foreach (var descriptorPool in commandList.DescriptorPools) { DescriptorPools.RecycleObject(fenceValue, descriptorPool); } DescriptorPoolLists.Release(commandList.DescriptorPools); commandList.DescriptorPools.Clear(); commandList.Builder.CommandBufferPool.RecycleObject(fenceValue, commandList.NativeCommandBuffer); }
public override void Dispose() { BufferPool.Release(Buffer); }