From edb952c9e7c5f2c108b6716e77ce307513607bae Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 3 Jan 2023 22:10:20 +0900 Subject: [PATCH] internal/graphicsdriver/metal: add comments --- internal/graphicsdriver/metal/graphics_darwin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/graphicsdriver/metal/graphics_darwin.go b/internal/graphicsdriver/metal/graphics_darwin.go index 234645565..1796b75d2 100644 --- a/internal/graphicsdriver/metal/graphics_darwin.go +++ b/internal/graphicsdriver/metal/graphics_darwin.go @@ -216,6 +216,8 @@ func (g *Graphics) flushIfNeeded(present bool) { if present { // This check is necessary when skipping to render the screen (SetScreenClearedEveryFrame(false)). if g.screenDrawable == (ca.MetalDrawable{}) { + // nextDrawable can return immediately when the command buffer is empty. + // TODO: Can we wait for a while to get the next drawable? (#2520) g.screenDrawable = g.view.nextDrawable() } if g.screenDrawable != (ca.MetalDrawable{}) {