From 5b8e5e0f953b7e591597f4b7d08a2c4bb5ab58b2 Mon Sep 17 00:00:00 2001 From: Mikhail Filimonov Date: Sat, 2 May 2026 10:07:13 +0100 Subject: [PATCH] metal transaction --- submodules/MetalEngine/Sources/MetalEngine.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/submodules/MetalEngine/Sources/MetalEngine.swift b/submodules/MetalEngine/Sources/MetalEngine.swift index 7fc7064245..8391e85a3b 100644 --- a/submodules/MetalEngine/Sources/MetalEngine.swift +++ b/submodules/MetalEngine/Sources/MetalEngine.swift @@ -1073,12 +1073,20 @@ public final class MetalEngine { #if targetEnvironment(simulator) if #available(iOS 13.0, *) { if let drawable = self.layer.nextDrawable() { - commandBuffer.present(drawable) + commandBuffer.addScheduledHandler { _ in + CATransaction.begin() + drawable.present() + CATransaction.commit() + } } } #else if let drawable = self.layer.nextDrawable() { - commandBuffer.present(drawable) + commandBuffer.addScheduledHandler { _ in + CATransaction.begin() + drawable.present() + CATransaction.commit() + } } #endif #endif