From 55d50c7fbdc34007c11d914b1bb699a87a3b26cc Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Sun, 30 Oct 2022 20:58:11 -0700 Subject: [PATCH] Mac: Wait for metal command buffer to finish before presenting drawable, properly this time --- macosx/mac-render.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/macosx/mac-render.mm b/macosx/mac-render.mm index f43f73b1..1a9fdb60 100644 --- a/macosx/mac-render.mm +++ b/macosx/mac-render.mm @@ -368,11 +368,13 @@ static void S9xPutImageMetal (int width, int height, uint16 *buffer16) [renderEncoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:6]; [renderEncoder endEncoding]; + + [commandBuffer commit]; + + [commandBuffer waitUntilCompleted]; - [commandBuffer presentDrawable:drawable]; + [drawable present]; } - - [commandBuffer commit]; } void S9xTextMode (void)