internal/graphicsdriver/metal: Optimize the screen writing

This commit is contained in:
Hajime Hoshi 2021-07-07 02:07:09 +09:00
parent 5e83f409e6
commit 80ac0646d5

View File

@ -796,10 +796,11 @@ func (g *Graphics) draw(rps mtl.RenderPipelineState, dst *Image, dstRegion drive
// (#1019). Always using mtl.LoadActionLoad is safe.
if dst.screen {
rpd.ColorAttachments[0].LoadAction = mtl.LoadActionClear
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionDontCare
} else {
rpd.ColorAttachments[0].LoadAction = mtl.LoadActionLoad
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
}
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
t := dst.mtlTexture()
g.lastDstTexture = t