Post

Replies

Boosts

Views

Activity

Memory leak on releasing MTLCommandBuffer
Hi! I'm trying to execute some kernels multiply times, but encoder creation, execution and deallocation called from different places, so i can't just put it into @autoreleasepool. Then i try to release command buffer manually nothing happens. Sample: for (int32_t i = 0; i<100000; ++i) { _commandBuffer = [_commandQueue commandBuffer];     _encoder = [_commandBuffer computeCommandEncoder];    ... setup encoder and execute [_encoder release]; [_commandBuffer release]; //encoder successfully released, but buffer still present and retain count = 1 _encoder = nil;     _commandBuffer = nil; } In result of this code program just eat all available memory. How can i fix this issue? Working sample with issue - https://developer.apple.com/forums/content/attachment/a159422c-1b0c-4878-a6d2-5517ad787eae
2
0
1.2k
Oct ’20