internal/graphicsdriver/metal: add comments

This commit is contained in:
Hajime Hoshi 2023-01-03 22:10:20 +09:00
parent 365740aca9
commit edb952c9e7

View File

@ -216,6 +216,8 @@ func (g *Graphics) flushIfNeeded(present bool) {
if present { if present {
// This check is necessary when skipping to render the screen (SetScreenClearedEveryFrame(false)). // This check is necessary when skipping to render the screen (SetScreenClearedEveryFrame(false)).
if g.screenDrawable == (ca.MetalDrawable{}) { 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() g.screenDrawable = g.view.nextDrawable()
} }
if g.screenDrawable != (ca.MetalDrawable{}) { if g.screenDrawable != (ca.MetalDrawable{}) {