mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
graphicsdriver/metal: Bug fix: avoid using mtl.LoadActionDontCare
Fixes #1019
This commit is contained in:
parent
38d8cbf6af
commit
9298b044e3
@ -587,13 +587,11 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode driver.CompositeMode,
|
|||||||
d.view.update()
|
d.view.update()
|
||||||
|
|
||||||
rpd := mtl.RenderPassDescriptor{}
|
rpd := mtl.RenderPassDescriptor{}
|
||||||
if d.dst.screen {
|
// Even though the destination pixels are not used, mtl.LoadActionDontCare might cause glitches
|
||||||
rpd.ColorAttachments[0].LoadAction = mtl.LoadActionDontCare
|
// (#1019). Always using mtl.LoadActionLoad is safe.
|
||||||
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
|
rpd.ColorAttachments[0].LoadAction = mtl.LoadActionLoad
|
||||||
} else {
|
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
|
||||||
rpd.ColorAttachments[0].LoadAction = mtl.LoadActionLoad
|
|
||||||
rpd.ColorAttachments[0].StoreAction = mtl.StoreActionStore
|
|
||||||
}
|
|
||||||
var t mtl.Texture
|
var t mtl.Texture
|
||||||
if d.dst.screen {
|
if d.dst.screen {
|
||||||
if d.screenDrawable == (ca.MetalDrawable{}) {
|
if d.screenDrawable == (ca.MetalDrawable{}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user