From 3ec02f767b1f86f122cca949c951826a76baa119 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 4 Jul 2021 18:37:14 +0900 Subject: [PATCH] internal/graphicsdriver/metal: Refactoring --- internal/graphicsdriver/metal/graphics.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/graphicsdriver/metal/graphics.go b/internal/graphicsdriver/metal/graphics.go index dc4ee3f44..b1459e4e2 100644 --- a/internal/graphicsdriver/metal/graphics.go +++ b/internal/graphicsdriver/metal/graphics.go @@ -379,6 +379,7 @@ func (g *Graphics) flushIfNeeded(present bool) { if g.cb == (mtl.CommandBuffer{}) { return } + g.flushRenderCommandEncoderIfNeeded() if present && g.screenDrawable != (ca.MetalDrawable{}) { g.cb.PresentDrawable(g.screenDrawable) @@ -801,10 +802,6 @@ func (g *Graphics) DrawTriangles(dstID driver.ImageID, srcIDs [graphics.ShaderIm return err } - if dst.screen { - g.flushRenderCommandEncoderIfNeeded() - } - return nil }