--- old/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m 2019-09-09 18:14:35.000000000 +0530 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m 2019-09-09 18:14:35.000000000 +0530 @@ -1080,7 +1080,16 @@ RESET_PREVIOUS_OP(); if (g_modifiedLayersCount != 0) { [mtlc endCommonRenderEncoder]; + id offScreenCommandBuffer = mtlc.commandBuffer; + J2dTraceLn(J2D_TRACE_VERBOSE, "offScreenCommandBuffer commit"); + [offScreenCommandBuffer commit]; + if (sync) { + J2dTraceLn(J2D_TRACE_VERBOSE, "sync is true"); + [offScreenCommandBuffer waitUntilCompleted]; + } + [mtlc releaseCommandBuffer]; } + BMTLSDOps *dstOps = MTLRenderQueue_GetCurrentDestination(); if (dstOps != NULL) { MTLSDOps *dstMTLOps = (MTLSDOps *)dstOps->privOps; @@ -1088,6 +1097,7 @@ if (layer != NULL) { [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; + J2dTraceLn(J2D_TRACE_VERBOSE, "Before setNeedsDisplay call"); [layer setNeedsDisplay]; }]; }