internal/graphicsdriver/metal: Refactoring

This commit is contained in:
Hajime Hoshi 2021-07-04 18:37:14 +09:00
parent 7f86761dde
commit 3ec02f767b

View File

@ -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
}