internal/graphicsdriver/metal: Bug fix: The store action must always be 'store'

Closes #1700
This commit is contained in:
Hajime Hoshi 2021-07-08 17:39:33 +09:00
parent 337d8d5113
commit ae0e30196b

View File

@ -792,12 +792,13 @@ 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
}
// The store action should always be 'store' even for the screen (#1700).
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
t := dst.mtlTexture()
if t == (mtl.Texture{}) {
return nil