Fixed metal rendering when presentsWithTransaction is enabled, based on Apple documentation:
Setting this value to YES makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s present method. To ensure that a transaction is available when you schedule the drawable to be presented, first commit the command buffer containing your Metal rendering commands. Then, call its waitUntilScheduled method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s present method.
Source: https://developer.apple.com/documentation/quartzcore/cametallayer/1478157-presentswithtransaction?language=objc.
Fixed metal rendering when
presentsWithTransaction
is enabled, based on Apple documentation: Setting this value to YES makes the layer draw its contents synchronously, using whichever Core Animation transaction is current at the time you call the drawable’s present method. To ensure that a transaction is available when you schedule the drawable to be presented, first commit the command buffer containing your Metal rendering commands. Then, call its waitUntilScheduled method to synchronously wait until the command queue schedules the command buffer to execute on the GPU. Finally, call the drawable’s present method. Source: https://developer.apple.com/documentation/quartzcore/cametallayer/1478157-presentswithtransaction?language=objc.This will fix correctly also the following issues: https://github.com/maplibre/maplibre-native/issues/2337, https://github.com/maplibre/maplibre-native/issues/2380, https://github.com/maplibre/maplibre-native/issues/2053, so I removed old hacks.
Allocations after the fix:
https://github.com/maplibre/maplibre-native/assets/19795769/8722d529-d974-49e8-aaa4-748a54b25e60